-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move heads of terms review into new layout #2047
Conversation
bf26dae
to
16910b7
Compare
app/controllers/planning_applications/review/heads_of_terms_controller.rb
Show resolved
Hide resolved
app/views/planning_applications/review/heads_of_terms/_form.html.erb
Outdated
Show resolved
Hide resolved
16910b7
to
8aec63a
Compare
app/views/planning_applications/review/tasks/_review_conditions.html.erb
Outdated
Show resolved
Hide resolved
app/views/planning_applications/review/tasks/_review_conditions.html.erb
Outdated
Show resolved
Hide resolved
5a66429
to
3adefdf
Compare
8e2620c
to
9d59302
Compare
def update | ||
respond_to do |format| | ||
format.html do | ||
if heads_of_term.update(review_params) | ||
redirect_to planning_application_review_tasks_path(@planning_application), | ||
notice: I18n.t("review.heads_of_terms.update.success") | ||
else | ||
render :show |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we apply same pattern?
change the
def heads_of_term
@planning_application.heads_of_term
end
to
def set_heads_of_term
@heads_of_term = @planning_application.heads_of_term
end
happy to do it as additional PR if you want
so this would be
flash.now[:alert] = @heads_of_term.errors.messages.values.flatten.join(", ")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like the pattern of using a method to set an instance variable and then using the instance variable. I think it's preferable to use a method call where possible.
It makes sense for variables that will be used in a view, because instance variables are needed for that, methods aren't accessible from the view. But for cases like this I don't think it makes sense.
9d59302
to
6a21841
Compare
Description of change
Move heads of terms review into new review layout.
Story Link
https://trello.com/c/Ae4hmaT1/26-redesign-of-review-heads-of-terms
Screenshots
If you have made changes to the frontend please add screenshots