RailsCasts Pro episodes are now free!

Learn more or hide this

Matt's Profile

GitHub User: mattmenefee

Comments by Matt

Avatar

Check out what sizing options come standard with bootstrap: http://twitter.github.com/bootstrap/base-css.html#forms

Add a CSS class to your form field, for example (using Simple Form):

<%= f.input :last_name, :input_html => { :class => 'input-medium' } %>

More info on using Simple Form: http://simple-form.plataformatec.com.br/#usage

If you're using Rails' Form_For, see the API: http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html

Avatar

Does anyone know how you would make the questions answerable (perhaps assuming that you were using Devise for user authentication and had access to current_user)? I'm guessing that you would have a model that stored the ID from a User model as well as an ID from the Answer model. So then on the show page, each answer that was listed would be a link that would allow the user to answer the question.

So i guess my question is: What code would you use to then save this into the database when the user clicked the link?

Also, is this the best way to go about this? should this actually use a form instead? It seems like an easy thing to do but I'm not sure of what the Rails way to approach it is. Thanks!