Hack hack hack...

An open journal-- some of it written for you, but most of it is for me.

Forms

Forms

forms are a collection of elements text element cant live by itself the entire sign up for needs to be submitted to one place group form elements together and you wrap them in a form

where its going has nothing to do with the information that it is passing in

every web request as a request and a response a request has to go somewhere– that’s urls– that’s the address forms pass along data for where we are going– go here and tell the server this

Input tags

the name in the form is the key of the params hash

1
2
3
4
#The html 
<input type="text", name="tag">
#in the controller
@airbrake_error.add_tags(params[:tag])
1
2
3
#if the form contains 
<%= text_field_tag(:query) %>
#then you would be able to get the value of this field in the controller with params[:query].
  • text_field_tag :name of the tag and then the prefilled value

  • f.text_field :comments is NESTED in airbrake error which is represented by f

  • The form doesn’t need a name– it is the wrapper. The input elements DO need names.

Understanding naming parameter conventions

Comments