How do I select the selected value in a select list? Can’t find any
documentation about that.
Pål Bergström wrote:
How do I select the selected value in a select list? Can’t find any
documentation about that.
I figured that out myself. Now I wonder how I can add a default value,
or a blank value but with a default value to that?
Pål Bergström wrote:
Pål Bergström wrote:
How do I select the selected value in a select list? Can’t find any
documentation about that.I figured that out myself. Now I wonder how I can add a default value,
or a blank value but with a default value to that?–
Posted via http://www.ruby-forum.com/.
Did you find a way to generate a select list with a selected value
using a build in rails method, or did you write one of your own? This
is something I needed to do recently, but I wrote my own method …
just wondering if there is a build in way!
stephen O’D wrote:
P�l Bergstr�m wrote:
P�l Bergstr�m wrote:
How do I select the selected value in a select list? Can’t find any
documentation about that.I figured that out myself. Now I wonder how I can add a default value,
or a blank value but with a default value to that?–
Posted via http://www.ruby-forum.com/.Did you find a way to generate a select list with a selected value
using a build in rails method, or did you write one of your own? This
is something I needed to do recently, but I wrote my own method …
just wondering if there is a build in way!
Not sure what you mean, but I learned it from Agile Web D.s
with Rails. There it states:
<%=
@users = User.find(:all, :order => “name”).map {|u| [u.name, u.id] }
select(:user, :name, @users)
%>
This way I can populate the list select() with data from the table Users
(in this case).
Besides that I’ve been really struggling to find answers about select
list, and many other things. Getting more and more frustrated with the
really poor documentation in Rails. But try to stay happy
Hopefully someone some day will write a better documentation.
Pål Bergström wrote:
This way I can populate the list select() with data from the table Users
(in this case).
And it will automatically select the current value in the db.