Sha256: 64b8d639c4e9e74fec7f2c8d239629420113fe06841a9e427a3cafb2f64bb4d3

Contents?: true

Size: 856 Bytes

Versions: 41

Compression:

Stored size: 856 Bytes

Contents

class <%= class_name %> < ActiveRecord::Base
  acts_as_content_block
  <% for attribute in attributes %><%= 
    case attribute.type
    when :attachment
      %Q{belongs_to_attachment
        
        def set_attachment_file_path
          # The default behavior is use /attachments/file.txt for the attachment path,
          # assuming file.txt was the name of the file the user uploaded
          # You should override this with your own strategy for setting the attachment path
          super
        end

        def set_attachment_section
          # The default behavior is to put all attachments in the root section
          # Override this method if you would like to change that
          super
        end}
    when :category
      "belongs_to_category\n"
    when :belongs_to
      "belongs_to :#{attribute.name}\n"
    end
%><% end %>

end

Version data entries

41 entries across 41 versions & 11 rubygems

Version Path
drujensen-browsercms-3.2.0 rails_generators/content_block/templates/content_block.rb
browsercmsi-3.1.2 rails_generators/content_block/templates/content_block.rb
browsercms-3.1.2 rails_generators/content_block/templates/content_block.rb
browsercms-3.1.1 rails_generators/content_block/templates/content_block.rb
browsercmsi-3.1.1 rails_generators/content_block/templates/content_block.rb
browsercmsi-3.1.0 rails_generators/content_block/templates/content_block.rb
browsercms-3.1.0 rails_generators/content_block/templates/content_block.rb
we5-browsercms-3.1.0 rails_generators/content_block/templates/content_block.rb
browsercms-3.0.6 rails_generators/content_block/templates/content_block.rb
browsercms-3.0.5 rails_generators/content_block/templates/content_block.rb
we5-browsercms-3.0.5.1 rails_generators/content_block/templates/content_block.rb
we5-browsercms-3.0.5 rails_generators/content_block/templates/content_block.rb
browsercms_s3-3.0.5 rails_generators/content_block/templates/content_block.rb
browsercms-3.0.4 rails_generators/content_block/templates/content_block.rb
browsercms-3.0.3 rails_generators/content_block/templates/content_block.rb
browsercms_s3-3.0.4 rails_generators/content_block/templates/content_block.rb
browsercms_s3-3.0.3 rails_generators/content_block/templates/content_block.rb
we5-browsercms-3.0.2 rails_generators/content_block/templates/content_block.rb
browsercms-3.0.2 rails_generators/content_block/templates/content_block.rb
browsercms-3.0.1 rails_generators/content_block/templates/content_block.rb