P
Phlip
[Still trying to safely get on the Rails mailing list...]
Rubies:
The great thing about Web programming is there's so many languages to chose
from - or mix together.
Specifically, an ERb page can contain 3 languages:
<select id="myList">
<% for record in @table %>
<option value="<%= record.id %>"><%= h(record.name) %></option>
<% end %>
</select>
Okay, that's a combobox with names and values in it.
Now how do I let the user select one option, and send it to the next page
with link_to()?
<%= link_to 'Go to Next Page',
{:action => 'goToNextPage', :id => ??? }
%>
The third potential language is JavaScript, so in theory I could add an
onclick event to each <option>, or similar, then express the link_to in raw
HTML...
<a id="linkOut" href="/page/goToNextPage/2">Go to Next Page</a>
....then use the onclick event to change the href attribute.
However, that's not very Railish, and I'm sure there's some feature
available which my newbescence has overlooked!
Rubies:
The great thing about Web programming is there's so many languages to chose
from - or mix together.
Specifically, an ERb page can contain 3 languages:
<select id="myList">
<% for record in @table %>
<option value="<%= record.id %>"><%= h(record.name) %></option>
<% end %>
</select>
Okay, that's a combobox with names and values in it.
Now how do I let the user select one option, and send it to the next page
with link_to()?
<%= link_to 'Go to Next Page',
{:action => 'goToNextPage', :id => ??? }
%>
The third potential language is JavaScript, so in theory I could add an
onclick event to each <option>, or similar, then express the link_to in raw
HTML...
<a id="linkOut" href="/page/goToNextPage/2">Go to Next Page</a>
....then use the onclick event to change the href attribute.
However, that's not very Railish, and I'm sure there's some feature
available which my newbescence has overlooked!