Ruby on Rails Sunday, November 13, 2016

I am going through the railstutorial.org book, so I am still a newbie
with ruby.

My goal is to create my own multi-site framework with admin pages
(including pages for administering uploaded files, users, and dynamical
pages). I have been experimenting with Refinery, but it may be too
difficult to modify for different purposes (not sure yet).

For now, based on the tutorial, I know how to use form_for to produce
forms. The fields are handled like this:

<%= f.label :name %>
<%= f.text_field :name, class: 'form-control' %>

What would be the neatest way to make this code more generic, so I don't
have to actually write the field names here and in several other places?

I need to iterate a field list either in db schema, or in a
manually-built array of fields.

- Jussi

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9852e485-8a69-999a-d8ef-daa1b62d6c99%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment