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
SFEley-browsercms-3.0.2 rails_generators/content_block/templates/content_block.rb
buzzware-browsercms-3.0.2 rails_generators/content_block/templates/content_block.rb
coredumplings-browsercms-3.0.0 rails_generators/content_block/templates/content_block.rb
nate-browsercms-3.0.210 rails_generators/content_block/templates/content_block.rb
nate-browsercms-3.0.211 rails_generators/content_block/templates/content_block.rb
we5-browsercms-3.0.1.1 rails_generators/content_block/templates/content_block.rb
webficient-browsercms-3.0.1 rails_generators/content_block/templates/content_block.rb
webficient-browsercms-3.0.2 rails_generators/content_block/templates/content_block.rb
webficient-browsercms-3.0.3 rails_generators/content_block/templates/content_block.rb
webficient-browsercms-3.0.4 rails_generators/content_block/templates/content_block.rb
browsercms-3.3.4 lib/generators/cms/content_block/templates/content_block.rb
browsercms-3.3.3 lib/generators/cms/content_block/templates/content_block.rb
browsercms-3.1.5 rails_generators/content_block/templates/content_block.rb
browsercms-3.1.4 rails_generators/content_block/templates/content_block.rb
browsercms-3.3.2 lib/generators/cms/content_block/templates/content_block.rb
browsercms-3.3.1 lib/generators/cms/content_block/templates/content_block.rb
browsercms-3.3.0 lib/generators/cms/content_block/templates/content_block.rb
browsercms-3.1.3 rails_generators/content_block/templates/content_block.rb
browsercms-3.3.0.beta lib/generators/cms/content_block/templates/content_block.rb
bf4-browsercms-3.1.0 rails_generators/content_block/templates/content_block.rb