Skip to content

Commit

Permalink
Merge pull request #531 from amatsuda/ApplicationHelper_in_controller
Browse files Browse the repository at this point in the history
Avoid including ApplicationHelper in a controller
  • Loading branch information
amatsuda authored Mar 9, 2025
2 parents 046225a + 36922e7 commit 3ecfb44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions app/controllers/proposals_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,12 @@ def update
end
end

include ApplicationHelper
def parse_edit_field
respond_to do |format|
format.js do
render locals: {
field_name: params[:name],
text: markdown(params[:text])
text: params[:text]
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/proposals/parse_edit_field.js.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$('[data-field-name="<%= field_name %>"]')[0].innerHTML = '<%=j text %>';
$('[data-field-name="<%= field_name %>"]')[0].innerHTML = '<%=j markdown(text) %>';

0 comments on commit 3ecfb44

Please sign in to comment.