5

I'd like to create a couple of forms on a Refinery based CMS site. One is a contact form, and another is a variation on this contact form with a few additional fields. For this form, I've looked at the Refinery inquiry gem but I can't seem to find a way of modifying the form for the additional fields, or embedding this on multiple pages (each of which has multiple languages through the i18n gem). I also stumbled across Refinery Engines which might meet my requirements, but it hasn't been updated in quite a while, so wasn't sure whether it would work with the latest version.

Is the Generators gem still in use? Has anyone used this gem for what I'm trying to achieve or what is the Refinery way of creating custom forms?

purpletonic
  • 1,858
  • 2
  • 18
  • 29

1 Answers1

4

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.

parndt
  • 1,873
  • 11
  • 13
  • 4
    Thanks @parndt, is this documented in the guides anywhere? I couldn't find it when I looked. – purpletonic Jul 09 '12 at 07:45
  • The trouble I'm having with this is that the form extension doesn't appear to be created with the necessary configuration to run Rspec tests. The forms themselves work well enough though. – CJBrew Jun 01 '14 at 15:37
  • To answer my question above: I have simply copied the tasks and specs folders from an Extension into the Form folder. Also the Gemfile and Rakefile, which seem to be missing. There may be other things... @parndt, do we not expect people to test the model behind a form? Is this a bug worthy of raising an issue on Refinery, or something that most users will be able to DIY? – CJBrew Jun 01 '14 at 20:26
  • @CJBrew yes, that'd be considered a bug. – parndt Jul 29 '14 at 11:03