4 ms·
Ah, that's neat. I usually just build these forms without the Rails helpers, using something like: <form> <input type='text' name='email' value='<%=
by 5vforest 13y ago
Ah, that's neat. I usually just build these forms without the Rails helpers, using something like:
<form>
<input type='text' name='email' value='<%= params[:email] %>' />
</form>
Which works out nicely, since the method defaults to 'GET' and the action defaults to the current path.
- deleted 13y ago[deleted]
- troels 13y agoIt'll do too, but I think it's nice to abstract the http-layer completely away from the view. In case you want to replicate, I believe the relevant part is simply adding this to the base class: extend ActiveModel::Naming include ActiveModel::AttributeMethods def to_key [] end And then add `attr_reader` for each field.