Permalink
Browse files

Merge pull request #11385 from MarceloCajueiro/remove_string_interpol…

…ation

Remove unnecessary string interpolation
  • Loading branch information...
2 parents a4c0281 + 07e7c09 commit 54d893f9d8d080596c8ce74f28ef181b60e2994f @rafaelfranca rafaelfranca committed Jul 10, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb
@@ -59,9 +59,9 @@ def set_<%= singular_table_name %>
# Only allow a trusted parameter "white list" through.
def <%= "#{singular_table_name}_params" %>
<%- if attributes_names.empty? -%>
- params[<%= ":#{singular_table_name}" %>]
+ params[:<%= singular_table_name %>]
<%- else -%>
- params.require(<%= ":#{singular_table_name}" %>).permit(<%= attributes_names.map { |name| ":#{name}" }.join(', ') %>)
+ params.require(:<%= singular_table_name %>).permit(<%= attributes_names.map { |name| ":#{name}" }.join(', ') %>)
<%- end -%>
end
end

0 comments on commit 54d893f

Please sign in to comment.