Just three quick questions: 1) when a user logs in, how do you redirect her to the last page they were on? 2) what do most use for a form field that lists all the states in a certain country? 3) when you create a form, the default size for the form is "size" => 30. Now I know I can change that number but what if I wanted to leave it out and control the width of my fields in css? also, how do I add a class="" to the form field (for css styling)? Thanks, Elle --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
1) you can store the last request they made in the session, then upon successful login, use redirect_to to redirect them there 2) I don''t so I will defer to others 3) <%= text_field :obj, :method, :class => ''foo'', :style => ''font-weight: bold;''-%> #etc, etc You should check out the full documentation at http://api.rubyonrails.org. -Bill elle wrote:> Just three quick questions: > 1) when a user logs in, how do you redirect her to the last page they > were on? > 2) what do most use for a form field that lists all the states in a > certain country? > 3) when you create a form, the default size for the form is "size" => > 30. Now I know I can change that number but what if I wanted to leave > it out and control the width of my fields in css? also, how do I add a > class="" to the form field (for css styling)? > > Thanks, > Elle > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks Bill. I''ve tried a plugin called state_select and it worked good as long as I wanted states from one country only. The plugin can''t display states from both US and Canada. So, I''ve added the following method to the application.rb: def state_dropdown states = ["Alabama", "Alaska", "Alberta", "Arizona", "Arkansas", "British Columbia", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Manitoba", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Brunswick", "New Hampshire", "New Jersey", "New Mexico", "New York", "Newfoundland", "North Carolina", "North Dakota", "Northwest Territories", "Nova Scotia", "Nunavut", "Ohio", "Oklahoma", "Ontario", "Oregon", "Pennsylvania", "Prince Edward Island", "Puerto Rico", "Quebec", "Rhode Island", "Saskatchewan", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "Washington D.C.", "West Virginia", "Wisconsin", "Wyoming", "Yukon"] states.each do | s | <option value="#{s}"> s </option> end end And I wanted to ask: 1) Is this the right place to add this method? 2) Would the above work? Thanks, Elle On Oct 24, 3:27 pm, William Pratt <bi...-YbheRAKfYF4eIZ0/mPfg9Q@public.gmane.org> wrote:> 1) you can store the last request they made in the session, then upon > successful login, use redirect_to to redirect them there > 2) I don''t so I will defer to others > 3) <%= text_field :obj, :method, :class => ''foo'', :style => > ''font-weight: bold;''-%> #etc, etc > > You should check out the full documentation athttp://api.rubyonrails.org. > > -Bill > > elle wrote: > > Just three quick questions: > > 1) when a user logs in, how do you redirect her to the last page they > > were on? > > 2) what do most use for a form field that lists all the states in a > > certain country? > > 3) when you create a form, the default size for the form is "size" => > > 30. Now I know I can change that number but what if I wanted to leave > > it out and control the width of my fields in css? also, how do I add a > > class="" to the form field (for css styling)? > > > Thanks, > > Elle--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> So, I''ve added the following method to the application.rb:Actually meant application_helper.rb Elle On Oct 27, 8:30 am, elle <wazne...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks Bill. > > I''ve tried a plugin called state_select and it worked good as long as > I wanted states from one country only. > The plugin can''t display states from both US and Canada. > So, I''ve added the following method to the application.rb: > > def state_dropdown > states = ["Alabama", "Alaska", "Alberta", "Arizona", "Arkansas", > "British Columbia", "California", "Colorado", "Connecticut", > "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", > "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", > "Manitoba", "Maryland", "Massachusetts", "Michigan", "Minnesota", > "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New > Brunswick", "New Hampshire", "New Jersey", "New Mexico", "New York", > "Newfoundland", "North Carolina", "North Dakota", "Northwest > Territories", "Nova Scotia", "Nunavut", "Ohio", "Oklahoma", "Ontario", > "Oregon", "Pennsylvania", "Prince Edward Island", "Puerto Rico", > "Quebec", "Rhode Island", "Saskatchewan", "South Carolina", "South > Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", > "Washington", "Washington D.C.", "West Virginia", "Wisconsin", > "Wyoming", "Yukon"] > states.each do | s | > <option value="#{s}"> s </option> > end > end > > And I wanted to ask: > 1) Is this the right place to add this method? > 2) Would the above work? > > Thanks, > Elle > > On Oct 24, 3:27 pm, William Pratt <bi...-YbheRAKfYF4eIZ0/mPfg9Q@public.gmane.org> wrote: > > > 1) you can store the last request they made in the session, then upon > > successful login, use redirect_to to redirect them there > > 2) I don''t so I will defer to others > > 3) <%= text_field :obj, :method, :class => ''foo'', :style => > > ''font-weight: bold;''-%> #etc, etc > > > You should check out the full documentation athttp://api.rubyonrails.org. > > > -Bill > > > elle wrote: > > > Just three quick questions: > > > 1) when a user logs in, how do you redirect her to the last page they > > > were on? > > > 2) what do most use for a form field that lists all the states in a > > > certain country? > > > 3) when you create a form, the default size for the form is "size" => > > > 30. Now I know I can change that number but what if I wanted to leave > > > it out and control the width of my fields in css? also, how do I add a > > > class="" to the form field (for css styling)? > > > > Thanks, > > > Elle--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---