Hi, I use the following code in a view to show a list of states inside a
form but I get not result, I mean I get no errors nor the expected HTML
code that should be something like <option …
Are you wrapping the collection_select code in <%= %> tags?
Nik N. wrote:
Hi, I use the following code in a view to show a list of states inside a
form but I get not result, I mean I get no errors nor the expected HTML
code that should be something like <option …
Hi William,
I’m a PHP developer and I’m testing RoR so I thought <% … %> was right
when writing more than one line of code! I just added “=” after “<%” and
it worked.
Thanks a lot! These are those little errors that can make you waste a
lot of time!
Nik
William P. wrote:
Are you wrapping the collection_select code in <%= %> tags?
Nik N. wrote:
Hi, I use the following code in a view to show a list of states inside a
form but I get not result, I mean I get no errors nor the expected HTML
code that should be something like <option …
No problem. <% %> should be around code that you do not want the output
added to the rendered page (adding a dash at the end like -%> will
suppress the newline) and <%= %> goes around code that will generate
output to be included in the rendered page. Hope this helps you.
Nik N. wrote:
Are you wrapping the collection_select code in <%= %> tags?