I have a view helper like ryan bates complex forms task helper, rails 2.2.2. Anyway is there a way to send the value selected in a select menu to the helper? I am trying to do stuff without going back to the server. <%= select_tag :discout_code, options_for_select(@discount_codes)%><%= add_exclusion_date_link(''Add Existing'', JS ) %> -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
http://railscasts.com/episodes/88-dynamic-select-menus -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ya I have seen that. How does that apply to what I am doing? On Wednesday, March 9, 2011 8:42:22 PM UTC-6, radhames brito wrote:> > http://railscasts.com/episodes/88-dynamic-select-menus-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Mar 10, 2011 at 9:43 AM, Me <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a view helper like ryan bates complex forms task helper, rails > 2.2.2. Anyway is there a way to send the value selected in a select menu to > the helper? I am trying to do stuff without going back to the server. > >if you''re trying to use the value selected by the user in your helper through js, you can''t. js is client side, helpers are server side.> <%= select_tag :discout_code, options_for_select(@discount_codes)%><%> add_exclusion_date_link(''Add Existing'', JS ) %> > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ok, is there another way to get this to work without going back to the server to just get a value from the select? On Wednesday, March 9, 2011 9:20:20 PM UTC-6, jim wrote:> > > > On Thu, Mar 10, 2011 at 9:43 AM, Me <chab...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> I have a view helper like ryan bates complex forms task helper, rails >> 2.2.2. Anyway is there a way to send the value selected in a select menu to >> the helper? I am trying to do stuff without going back to the server. >> >> > if you''re trying to use the value selected by the user in your helper > through js, you can''t. > js is client side, helpers are server side. > > >> <%= select_tag :discout_code, options_for_select(@discount_codes)%><%= >> add_exclusion_date_link(''Add Existing'', JS ) %> >> >> -- >> 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 rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > > > -- > ------------------------------------------------------------- > visit my blog at http://jimlabs.heroku.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Mar 10, 2011 at 11:39 AM, Me <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Ok, is there another way to get this to work without going back to the > server to just get a value from the select? > > On Wednesday, March 9, 2011 9:20:20 PM UTC-6, jim wrote: >> >> >> >> On Thu, Mar 10, 2011 at 9:43 AM, Me <chab...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> I have a view helper like ryan bates complex forms task helper, rails >>> 2.2.2. Anyway is there a way to send the value selected in a select menu to >>> the helper? I am trying to do stuff without going back to the server. >>> >>> >> if you''re trying to use the value selected by the user in your helper >> through js, you can''t. >> js is client side, helpers are server side. >> >> >>> <%= select_tag :discout_code, options_for_select(@discount_codes)%><%>>> add_exclusion_date_link(''Add Existing'', JS ) %> >>> >>> -- >>> 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 rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To unsubscribe from this group, send email to >>> rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> >>> For more options, visit this group at >>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>> >> >> >> >> -- >> ------------------------------------------------------------- >> visit my blog at http://jimlabs.heroku.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Mar 10, 2011 at 11:39 AM, Me <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Ok, is there another way to get this to work without going back to the > server to just get a value from the select? > >please don''t top post. what are you trying to achieve? give use some code snippets.> On Wednesday, March 9, 2011 9:20:20 PM UTC-6, jim wrote: >> >> >> >> On Thu, Mar 10, 2011 at 9:43 AM, Me <chab...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> I have a view helper like ryan bates complex forms task helper, rails >>> 2.2.2. Anyway is there a way to send the value selected in a select menu to >>> the helper? I am trying to do stuff without going back to the server. >>> >>> >> if you''re trying to use the value selected by the user in your helper >> through js, you can''t. >> js is client side, helpers are server side. >> >> >>> <%= select_tag :discout_code, options_for_select(@discount_codes)%><%>>> add_exclusion_date_link(''Add Existing'', JS ) %> >>> >>> -- >>> 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 rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To unsubscribe from this group, send email to >>> rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> >>> For more options, visit this group at >>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>> >> >> >> >> -- >> ------------------------------------------------------------- >> visit my blog at http://jimlabs.heroku.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wednesday, March 9, 2011 9:55:34 PM UTC-6, jim wrote:> > Not sure where to put this but here is the code again: ><%= select_tag :discount_code, options_for_select(@discount_ codes)%><%= add_exclusion_date_link(''Add Existing'', Select Value goes here ) %>> > On Thu, Mar 10, 2011 at 11:39 AM, Me <chab...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Ok, is there another way to get this to work without going back to the >> server to just get a value from the select? >> >> On Wednesday, March 9, 2011 9:20:20 PM UTC-6, jim wrote: >>> >>> >>> >>> On Thu, Mar 10, 2011 at 9:43 AM, Me <cha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>>> I have a view helper like ryan bates complex forms task helper, rails >>>> 2.2.2. Anyway is there a way to send the value selected in a select menu to >>>> the helper? I am trying to do stuff without going back to the server. >>>> >>>> >>> if you''re trying to use the value selected by the user in your helper >>> through js, you can''t. >>> js is client side, helpers are server side. >>> >>> >>>> <%= select_tag :discout_code, options_for_select(@discount_codes)%><%= >>>> add_exclusion_date_link(''Add Existing'', JS ) %> >>>> >>>> -- >>>> 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 rubyo...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> To unsubscribe from this group, send email to >>>> rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> >>>> For more options, visit this group at >>>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>>> >>> >>> >>> >>> -- >>> ------------------------------------------------------------- >>> visit my blog at http://jimlabs.heroku.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 rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > > > -- > ------------------------------------------------------------- > visit my blog at http://jimlabs.heroku.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wednesday, March 9, 2011 9:57:02 PM UTC-6, jim wrote:> > > > On Thu, Mar 10, 2011 at 11:39 AM, Me <chab...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Ok, is there another way to get this to work without going back to the >> server to just get a value from the select? >> >> > please don''t top post. > > what are you trying to achieve? give use some code snippets. >Here is the partial: <div class="form_field code-column "> <% fields_for_exclusion_date(excluded_date) do |excluded_date_attr| %> <%= excluded_date_attr.label :exclusion_date,''Excluded Date:'' -%> <%= excluded_date_attr.calendar_date_select :excluded_date, :class => "valid_from_date-input text-input",:value => value %> <%= link_to_function "remove", "$(this).up(''.form_field'').remove()" %> <% end %> </div> Here is the view: <%= select_tag :discout_code, options_for_select(@discount_ codes)%><%= add_exclusion_date_link(''Add Existing'', Select value goes here ) %>> > >> On Wednesday, March 9, 2011 9:20:20 PM UTC-6, jim wrote: >>> >>> >>> >>> On Thu, Mar 10, 2011 at 9:43 AM, Me <cha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>>> I have a view helper like ryan bates complex forms task helper, rails >>>> 2.2.2. Anyway is there a way to send the value selected in a select menu to >>>> the helper? I am trying to do stuff without going back to the server. >>>> >>>> >>> if you''re trying to use the value selected by the user in your helper >>> through js, you can''t. >>> js is client side, helpers are server side. >>> >>> >>>> <%= select_tag :discout_code, options_for_select(@discount_codes)%><%= >>>> add_exclusion_date_link(''Add Existing'', JS ) %> >>>> >>>> -- >>>> 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 rubyo...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> To unsubscribe from this group, send email to >>>> rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> >>>> For more options, visit this group at >>>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>>> >>> >>> >>> >>> -- >>> ------------------------------------------------------------- >>> visit my blog at http://jimlabs.heroku.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 rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > > > -- > ------------------------------------------------------------- > visit my blog at http://jimlabs.heroku.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Mar 10, 2011 at 12:04 PM, Me <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Wednesday, March 9, 2011 9:57:02 PM UTC-6, jim wrote: > >> >> >> On Thu, Mar 10, 2011 at 11:39 AM, Me <chab...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> Ok, is there another way to get this to work without going back to the >>> server to just get a value from the select? >>> >>> >> please don''t top post. >> >> what are you trying to achieve? give use some code snippets. >> > > Here is the partial: > <div class="form_field code-column "> > <% fields_for_exclusion_date(excluded_date) do |excluded_date_attr| %> > <%= excluded_date_attr.label :exclusion_date,''Excluded Date:'' -%> > <%= excluded_date_attr.calendar_date_select :excluded_date, :class > => "valid_from_date-input text-input",:value => value %> > <%= link_to_function "remove", "$(this).up(''.form_field'').remove()" > %> > <% end %> > </div> > > Here is the view: > > <%= select_tag :discout_code, options_for_select(@discount_ > codes)%><%= add_exclusion_date_link(''Add Existing'', Select value goes here > ) %> > >> >> >try updating the value attribute of the line that uses calendar_date_select via js? so always render the partial but on change of select value, update the value attribute.> On Wednesday, March 9, 2011 9:20:20 PM UTC-6, jim wrote: >>> >>>> >>>> >>>> On Thu, Mar 10, 2011 at 9:43 AM, Me <cha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>> >>>>> I have a view helper like ryan bates complex forms task helper, rails >>>>> 2.2.2. Anyway is there a way to send the value selected in a select menu to >>>>> the helper? I am trying to do stuff without going back to the server. >>>>> >>>>> >>>> if you''re trying to use the value selected by the user in your helper >>>> through js, you can''t. >>>> js is client side, helpers are server side. >>>> >>>> >>>>> <%= select_tag :discout_code, options_for_select(@discount_codes)%><%>>>>> add_exclusion_date_link(''Add Existing'', JS ) %> >>>>> >>>>> -- >>>>> 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 rubyo...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> To unsubscribe from this group, send email to >>>>> rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> >>>>> For more options, visit this group at >>>>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>>>> >>>> >>>> >>>> >>>> -- >>>> ------------------------------------------------------------- >>>> visit my blog at http://jimlabs.heroku.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 rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To unsubscribe from this group, send email to >>> rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> For more options, visit this group at >>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>> >> >> >> >> -- >> ------------------------------------------------------------- >> visit my blog at http://jimlabs.heroku.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Mar 9, 2011 at 10:55 PM, Me <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Ya I have seen that. How does that apply to what I am doing? > > >grab the input:select with jquery, is easy, the video shows a bit about dealing with selects, after that $.ajax{ type: ''POST'', url: ''controller/action'' data : { value: ''grab it from the element''}, success: jadah , jadah, jadah error: jadah , jadah, jadah } set the route for the action create an action that responds to XHR if you have any problem traversing the html paste some html output to see if i can help you grab the element -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.