Sha256: 7643d117e050ff5140da097c0606cd8d00f5dbc2f3f89873f5315c414a789cf5
Contents?: true
Size: 586 Bytes
Versions: 83
Compression:
Stored size: 586 Bytes
Contents
<% collections = attributes.select {|a| a.name.match(/_id$/)}.map {|a| a.name.gsub(/_id$/, '')}.uniq -%> class Tenon::<%= class_name.pluralize %>Controller < Tenon::SimpleResourcesController <% unless collections.blank? -%> before_filter :get_collections, :only => [:index, :edit, :update, :new, :create] <% end -%> <% unless collections.blank? -%> private def get_collections <% collections.each do |c| -%> @<%= c.pluralize %> = <%= c.camelize %>.all <% end -%> end <% end -%> def resource_params params.require(:<%= singular_name %>).permit! end end
Version data entries
83 entries across 83 versions & 1 rubygems