Sorry to post two newbie questions in one day
I'm trying to make a new Character row in my database. It has several values in the row, but I only need 2 or so from the user and the rest can be figured out by the app. My problem is I'm having trouble figuring out how to get a specific value from params.
For the record, I'm still in Rails 1.2.6.
So the form for the Character object should gather the Character's codename, as well as the Character's Power Level.
I want to gather the two paramters, do some calculations, and then actually do the creation, rather than having the user hard code all the values in a form and doing mass assignment.
So, the form I have now looks like this: <% form_tag(:action => 'create') do %> Â Â <%= text_field 'character', 'codename' %> Â Â Â Â Â Â Â Â <%= text_field 'character', 'power_level' %> Â Â <%= submit_tag "Create Character" %> <% end %>
I expect my create method will contain something like this: character = Character.new do |c| Â Â Â Â c.codename = [Codename Parameter] Â Â Â Â c.power_level = [Powerlevel Parameter] Â Â Â Â c.power_points = [Powerlevel Parameter * 15] Â Â Â Â ... end
However, I can't figure out how to retrieve the individual values brought over from the form.