Jump to content

The ultimate community for Ruby on Rails developers.


Photo

link_to - inserting letter from 'for char 'A' .. 'Z' % into url


  • Please log in to reply
1 reply to this topic

#1 haribo2014

haribo2014

    Passenger

  • Members
  • 2 posts

Posted 05 March 2014 - 09:35 PM

Hi,

 

I'm very new to Rails. I'm trying to make whatever letter the user selects pass into the URL. 

 

I'm really unsure about how to pass the parameters into this. Can anyone help? 

 

 

<% for char in 'A' .. 'Z' %>
<%= link_to char, 'words/letter/char' %>
<% end %>
 
 


#2 himanshu339

himanshu339

    Passenger

  • Members
  • 9 posts

Posted 17 March 2014 - 07:40 AM

you need to create a form and a text field. You can then pass the value entered in the text field to the controller.

 

I hope this helps!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users