Sha256: 8eff06ad50f9b9d3e19769f1eda8c3ae89ad6ab10feca4ca7bf9ecfaf9362a53
Contents?: true
Size: 996 Bytes
Versions: 11
Compression:
Stored size: 996 Bytes
Contents
module Refinery module <%= namespacing %> module Admin class <%= class_name.pluralize %>Controller < ::Refinery::AdminController crudify :'refinery/<%= namespacing.underscore %>/<%= singular_name %>'<% if (title = attributes.detect { |a| a.type.to_s =~ /string|text/ }).present? and title.name != 'title' -%>, :title_attribute => '<%= title.name %>'<% end -%><% if plural_name == singular_name -%>, :redirect_to_url => :refinery_<%= namespacing.underscore %>_admin_<%= singular_name %>_index_path<% end %> private # Only allow a trusted parameter "white list" through. def <%= "#{singular_table_name}_params" %> <%- if attributes_names.empty? -%> params[:<%= singular_table_name %>] <%- else -%> params.require(:<%= singular_table_name %>).permit(<%= attributes.map { |attr| ":#{attr.column_name}" }.join(', ') %>) <%- end -%> end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems