Sha256: b3bd0b515282386cf221c75ba0f59c2d248ff32f19e36be107696af5eddc48d3
Contents?: true
Size: 580 Bytes
Versions: 83
Compression:
Stored size: 580 Bytes
Contents
<% collections = attributes.select {|a| a.name.match(/_id$/)}.map {|a| a.name.gsub(/_id$/, '')}.uniq -%> class Tenon::<%= class_name.pluralize %>Controller < Tenon::ResourcesController <% 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