Skip to content

Commit

Permalink
fix hidden_fields for form_with
Browse files Browse the repository at this point in the history
  • Loading branch information
pushcx committed Dec 22, 2018
1 parent c6759f3 commit b10d659
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions app/views/comments/_commentbox.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ data-shortid="<%= comment.short_id if comment.persisted? %>">
<%= errors_for comment %>
<% end %>

<%= f.hidden_field "story_id", :value => comment.story.short_id %>
<%= f.hidden_field "story_id", value: comment.story.short_id %>

<% if comment.parent_comment %>
<%= f.hidden_field "parent_comment_short_id",
comment.parent_comment.short_id %>
<%= f.hidden_field "parent_comment_short_id", value: comment.parent_comment.short_id %>
<% end %>

<div style="width: 100%;">
Expand Down
2 changes: 1 addition & 1 deletion app/views/login/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<% end %>

<% if @referer.present? %>
<%= hidden_field_tag :referer, @referer %>
<%= form.hidden_field :referer, value: @referer %>
<% end %>
<% end %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/_invitationform.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ don't personally know.

<%= form_with url: invitations_path, :method => :post do |f| %>
<% if defined?(return_home) && return_home %>
<%= f.hidden_field :return_home, 1 %>
<%= f.hidden_field :return_home, value: 1 %>
<% end %>

<div class="boxline">
Expand Down

0 comments on commit b10d659

Please sign in to comment.