First! Make an app to test our awesome forms!

When trying to get a rails app up and running as quickly as possible, I have found generating a controller with specific views to be most useful. Example. Using new and result will automatically set a ‘get’ for new and result as well as a “new.html.erb” and “result.html.erb”.


Screen Shot 2015-10-02 at 8.20.10 AM


Simple Form Tag

You can manipulate this in very simple ways. It can be used to create and post or simply do a search. The options are very diverse for this type of form and for sake of demonstration I have simply created a ‘get’ method and passed the value so you may see what is occurring. It is very easy to create a post method but for sake of brevity only ‘gets’ was used. Using the ‘gets’ allows me to easily just have the results page open when submit is clicked. Rails allows for builders to take in a specific path and method using <%= form_tag(“form/result”, method: “get”) do %>. 

Screen Shot 2015-10-02 at 8.56.47 AM


Screen Shot 2015-10-02 at 8.58.23 AM


Screen Shot 2015-10-02 at 8.58.35 AM


Checkboxes

If you wanted to make a checkbox and grab its value its super simple. By default using rails to generate a check box sets values automagically to the value of 1. You my change its value by simply adding a parameter right after replacing the 1.


Screen Shot 2015-10-05 at 8.08.36 AM


 

Screen Shot 2015-10-05 at 8.08.47 AM


Screen Shot 2015-10-02 at 9.37.37 AM


Screen Shot 2015-10-05 at 8.07.31 AM


Radio Button

Much like a checkbox radio buttons give you a range of options but only allows you to check one option.

Screen Shot 2015-10-05 at 8.21.34 AM


Screen Shot 2015-10-05 at 8.20.55 AM


Screen Shot 2015-10-05 at 8.20.59 AM


Select Form

Screen Shot 2015-10-05 at 8.53.41 AM


Screen Shot 2015-10-05 at 8.53.49 AM


Screen Shot 2015-10-05 at 8.53.58 AM


Password Field

Screen Shot 2015-10-05 at 8.57.46 AM


Screen Shot 2015-10-05 at 8.57.56 AM


Screen Shot 2015-10-05 at 8.58.00 AM


Password Field


Screen Shot 2015-10-05 at 9.01.14 AM


Screen Shot 2015-10-05 at 9.23.01 AM


Screen Shot 2015-10-05 at 9.23.04 AM