Custom fields in Refinery CMS
Have a look at the (excellent) Getting Started with Refinery guide. In Section 6 the guide lays out how to add extra fields - in the example date, picture and blurb - using engines:
http://refinerycms.com/guides/getting-started-with-refinery#extending-refinery-with-your-first-engine
Refinery CMS: Adding custom field to custom engine index page
Our preference however is to create custom page parts in the normal pages section, rather than to use the copywriting engine.
Under the pages admin section you should see that a page has been added for pianos.
If you add a new page part (or even use an existing one), you can then retrieve and render it from the engine's index page like this:
<%= raw @page.content_for(:new_page_part) %>
How do you loop through a field on a custom engine in refinery cms
To the best of my knowledge there isn't a built-in Refinery process for this. has_many
would be the way I would approach the problem.
how to add custom routes to refinerycms
@manosagent, i can add routes like that:
Refinery::Core::Engine.routes.prepend do
get 'news/more' => 'news::items#view_more', as: :news_view_more
get 'notices/more' => 'notices::notices#view_more', as: :notices_view_more
end
but i don't understand why new/more
appears twice in rake routes
, i need to dig deeper ...
What is the currently accepted way to embed forms in Refinery CMS sites?
The refinerycms-generators extension was merged into Refinery itself and there exists a form generator in there. To get the syntax, just run:
rails generate refinery:form
It will present you with the help for the generator.
This is currently your best bet for spending the least amount of effort to get forms like refinerycms-inquiries.
Related Topics
Vps Apache Config - Invalid Command 'Passengerdefaultruby' After Adding Latest Passenger Gem
Instantiate Capybara Browser and Set a Proxy
Can Ruby Tell If It Is Called from an Interactive Shell or Cron
How to Display a Link to Individual Microposts? (Ruby on Rails 3)
How to Create Activerecord Style Validations Outside of Activerecord
How to Sign Out in a Rails App, Using Devise Gem, No Route Matches /Users/Sign_Out
Setting Up a Polymorphic Association
How to Extract Specific Elements from an Array
With Nokogiri I am Getting Error "Initialize': Getaddrinfo: No Such Host Is Known. (Socketerror)"
Using Sed to Append Lines to File During Vagrant Provisioning
Ruby on Rails - Error Making New App (Rb:55:In 'Require')
Marshal (Ruby) Pipes: Sending Serialized Object to Child Processes
Selenium Webdriver & Chrome Driver - Not Able to Run Chrome Driver
Modern Tools for Ruby/Rails for Building an Achievement System
How to Add 'Each' Method to Ruby Object (Or Should I Extend Array)