What if I just want to set the datetime in new and display a datetime column with it''s date in edit but not let the user change it, how do I do that? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Pål Bergström wrote:> What if I just want to set the datetime in new and display a datetime > column with it''s date in edit but not let the user change it, how do I > do that?<%= you_object.your_date_field %> Or try using the option {:disabled => true} in your form helper... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
bmgz wrote:> P�l Bergstr�m wrote: >> What if I just want to set the datetime in new and display a datetime >> column with it''s date in edit but not let the user change it, how do I >> do that? > > <%= you_object.your_date_field %> > > Or try using the option {:disabled => true} in your form helper...How do I do that? This is the form: <%= start_form_tag :action => ''create'' %> <%= render :partial => ''form'' %> <div class="submit"> <%= submit_tag "Create" %> </div> <%= end_form_tag %> <%= link_to ''Back'', :action => ''list'' %> -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
> How do I do that? This is the form:... This is the line renders the form''s contents:> <%= render :partial => ''form'' %>It is rendering another file named "_form.rhtml" which is probably in the same folder you found the one you quoted (''new.rhtml''?). The ''_'' indicates the file is to be rendered as a partial (as in partial page). Look in that file and you will see where the date field is being rendered. Play with that a bit. That''s where you might try Bmgz''s suggestion:> Or try using the option {:disabled => true} in your form helper...Caveat: The _form.rhtml file is used by both the ''new.rhtml'' and ''edit.rhtml'' pages. So if you change it it will be that way on both. To work around this you could create a different partial and render that instead... Good luck with Rails! -- (********************************************************** * Peter H. Boling * Web Application Designer - PanEther, LLC * email: peter.boling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org * blog: http://galtzo.blogspot.com/ * languages: English, Spanish, Portuguese ***********************************************************) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---