I''m trying to populate data from a database and assign the data to form.label. The data in the database is in all caps but when it is displayed in my browser it is first character upper and the rest lower. How can I keep the text in uppercase? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Daniel wrote:> I''m trying to populate data from a database and assign the data to > form.label. The data in the database is in all caps but when it is > displayed in my browser it is first character upper and the rest > lower. How can I keep the text in uppercase?Hi Daniel, What is the relevant view code? Peace, Phillip -- 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 -~----------~----~----~----~------~----~------~--~---
Daniel wrote:> The f.label(subject.name) will change the case (which is in all caps) > to first letter upper and the rest lower. What I''m displaying are > acronyms and they need to be capitalized but the other words need > their case to remain the same (upper and lower). So basically I want > rails to ignore the case and just display it as is.I guess the easiest answer is a simple question: must you use f.label? Why not just output the text with h? I hope this is not an obvious question. I have never actually used label. Phillip -- 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 -~----------~----~----~----~------~----~------~--~---
That was it! I''m currently learning Rails so most of my work is from a book right now. I have another question...I''m having a hard time learning how to work with checkboxes and I would like to be able to verify if a check box is checked after submitting a form and then to search the database using the index "id" of the checked box. Could you give me some direction using ''pseudo code'' on how I can do this in Rails? On Jul 13, 6:12 pm, Phillip Koebbe <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Daniel wrote: > > The f.label(subject.name) will change the case (which is in all caps) > > to first letter upper and the rest lower. What I''m displaying are > > acronyms and they need to be capitalized but the other words need > > their case to remain the same (upper and lower). So basically I want > > rails to ignore the case and just display it as is. > > I guess the easiest answer is a simple question: must you use f.label? > Why not just output the text with h? > I hope this is not an obvious question. I have never actually used > label. > > Phillip > -- > 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Here''s what I have so far: def enter_subjects for selected_subject in params[:tutor_subjects] if selected_subject == 1 @tutor_subject = TutorSubjects.new() @tutor_subject.tutor_id = Tutors.find(:id, :conditions => "email = #session[:email]") @tutor_subject.subject = Subjects.find(:name, :conditions => "id = #selected_subject") if @tutor_subject.sav redirect_to :action => "tutor_city" else flash[:notice] = ''Tutor was not created successfully.'' redirect_to :action => "tutor_city" end end end end On Jul 13, 6:46 pm, Daniel <daniel.combi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> That was it! I''m currently learning Rails so most of my work is from > a book right now. I have another question...I''m having a hard time > learning how to work with checkboxes and I would like to be able to > verify if a check box is checked after submitting a form and then to > search the database using the index "id" of the checked box. Could > you give me some direction using ''pseudo code'' on how I can do this in > Rails? > > On Jul 13, 6:12 pm, Phillip Koebbe <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > > Daniel wrote: > > > The f.label(subject.name) will change the case (which is in all caps) > > > to first letter upper and the rest lower. What I''m displaying are > > > acronyms and they need to be capitalized but the other words need > > > their case to remain the same (upper and lower). So basically I want > > > rails to ignore the case and just display it as is. > > > I guess the easiest answer is a simple question: must you use f.label? > > Why not just output the text with h? > > I hope this is not an obvious question. I have never actually used > > label. > > > Phillip > > -- > > 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Daniel wrote:> That was it! I''m currently learning Rails so most of my work is from > a book right now. I have another question...I''m having a hard time > learning how to work with checkboxes and I would like to be able to > verify if a check box is checked after submitting a form and then to > search the database using the index "id" of the checked box. Could > you give me some direction using ''pseudo code'' on how I can do this in > Rails? > > On Jul 13, 6:12�pm, Phillip Koebbe <rails-mailing-l...@andreas-s.net>Hi Daniel, Here''s a quick example of working with a checkbox. in a view file (I am using the Malline plugin for views, so you''ll need to write this as ERb): form_remote_tag(:url => {:controller => :welcome, :action => :check}, :update => :check_div) do _check_box_tag :my_check, ''true'' _submit_tag ''Check'' end div.check_div! do end Then in the controller: def check render :text => (params[:my_check] ? params[:my_check] == ''true'' : ''Not present'') end # check Notice that I''m checking to see if my_check is part of params. This is because HTML forms do not send checkboxes that are not checked. This may not be the case for FormBuilder, though. So it might depend on whether you are using form_for or just form_tag (or the remote counter parts). Peace, Phillip -- 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?hl=en -~----------~----~----~----~------~----~------~--~---