hi all pls can any one tell me how to set a text_field to un-editable in ROR. i have to set a values for it and have to make it un-editable. pls can some body help on this. Thanks -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
add a ''disabled'' => ''true'', e.g. <%= text_field ''post'', ''title'', ''size'' => 30, ''disabled'' => ''true'' %> On Dec 5, 4:20 am, Nadeesha Meththananda <rails-mailing-l...@andreas- s.net> wrote:> hi all > > pls can any one tell me how to set a text_field to un-editable in ROR. > > i have to set a values for it and have to make it un-editable. > > pls can some body help on this. > > Thanks > -- > Posted viahttp://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?hl=en -~----------~----~----~----~------~----~------~--~---
On 05 Dec 2007, at 14:10, rubynuby wrote:> add a ''disabled'' => ''true'', e.g. > > <%= text_field ''post'', ''title'', ''size'' => 30, ''disabled'' => ''true'' %>The XHTML definition clearly states it should be disabled="disabled" (http://www.w3schools.com/xhtml/xhtml_syntax.asp) I also prefer the use of symbols for extra parameters. <%= text_field "post", "title", :size => 30, :disabled => "disabled" %> Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 5, 5:37 am, Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> On 05 Dec 2007, at 14:10, rubynuby wrote: > > > add a ''disabled'' => ''true'', e.g. > > > <%= text_field ''post'', ''title'', ''size'' => 30, ''disabled'' => ''true'' %> > > The XHTML definition clearly states it should be > disabled="disabled" (http://www.w3schools.com/xhtml/xhtml_syntax.asp) > I also prefer the use of symbols for extra parameters. > > <%= text_field "post", "title", :size => 30, :disabled => "disabled" %> > > Best regards > > Peter De Berdtthank you for the correction. I did use symbols in my code but looking at the doc http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M000506 it uses strings, so I changed it. One of the more confusingg aspects of Ruby. sometimes it seems strings and symbols are interchangeable, and sometimes they''re not. --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
If you pass :disabled => true, rails will properly spit out disabled="disabled". -Bill rubynuby wrote:> > On Dec 5, 5:37 am, Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote: > >> On 05 Dec 2007, at 14:10, rubynuby wrote: >> >> >>> add a ''disabled'' => ''true'', e.g. >>> >>> <%= text_field ''post'', ''title'', ''size'' => 30, ''disabled'' => ''true'' %> >>> >> The XHTML definition clearly states it should be >> disabled="disabled" (http://www.w3schools.com/xhtml/xhtml_syntax.asp) >> I also prefer the use of symbols for extra parameters. >> >> <%= text_field "post", "title", :size => 30, :disabled => "disabled" %> >> >> Best regards >> >> Peter De Berdt >> > > thank you for the correction. I did use symbols in my code but > looking at the doc > > http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M000506 > > it uses strings, so I changed it. > > One of the more confusingg aspects of Ruby. sometimes it seems > strings and symbols are interchangeable, and sometimes they''re not. > > >--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Nadeesha Meththananda
2007-Dec-06 03:35 UTC
Re: how to set a text_field to un-editable in ROR
William Pratt wrote:> If you pass :disabled => true, rails will properly spit out > disabled="disabled". > > -BillHi guys, thanks a lot for the reply specially with the correct descriptions and telling what the actual process happen in Ruby. thanks nadeesha -- 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?hl=en -~----------~----~----~----~------~----~------~--~---