I’m trying to automatically fill a “posted_by” text by with whoever is
logged into the session. How do you set the value attribute using “<%=
text_field … %>”???
I’ve tried:
<%= text_field ‘post’, ‘posted_by’, ‘value’ =>
User.find(session[:user_id]).name.capitalize) %>
But I get errors.
If someone can tell me how to do this simple thing, I would really
appreciate it! Thanks!
To make your method work:
<%= text_field ‘post’, ‘posted_by’, :value =>
User.find(session[:user_id]).name.capitalize) %>
On 5/8/06, rh [email protected] wrote:
If someone can tell me how to do this simple thing, I would really
appreciate it! Thanks!
–
Posted via http://www.ruby-forum.com/.
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
–
Ben R.
303-947-0446
http://www.benr75.com
try:
<%= text_field ‘post’, ‘posted_by’,
User.find(session[:user_id]).name.capitalize)
%>
Why not store session[:user_id] in the posted_by field?
~ Ben
On 5/8/06, rh [email protected] wrote:
If someone can tell me how to do this simple thing, I would really
appreciate it! Thanks!
–
Posted via http://www.ruby-forum.com/.
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
–
Ben R.
303-947-0446
http://www.benr75.com
Thanks everyone, it works now.