Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove unnecessary string interpolation

Removed from controller template of scaffold generator.
  • Loading branch information...
commit 07e7c099b506afee4e1304c8cbe451271e51ee72 1 parent 16e4d01
@MarceloCajueiro MarceloCajueiro authored
View
4 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
Please sign in to comment.
Something went wrong with that request. Please try again.