Hi every one, i need something like populating all the states when a particular country selected. My exact requirement is, in my project management tool, when a project is selected all of its activities should be populated in the next drop down. I think before rails 3 it can be done using observe_field tag. But how to do that in rails 3 ( 3.0.10 to be precise) . -- 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.
Hi Venkata, On Sun, Jan 8, 2012 at 1:57 AM, venkata reddy <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi every one, > i need something like populating all the states > when a particular country selected. My exact requirement is, in my > project management tool, when a project is selected all of its > activities should be populated in the next drop down. I think before > rails 3 it can be done using observe_field tag. But how to do that in > rails 3 ( 3.0.10 to be precise) .AFAIK, the ''observe...'' helpers have not been replicated for jquery ( I miss them, too) so the easiest way is to swap out jquery and use prototoype.js. jQuery is now the default, but you can continue to use prototype.js if you like. Best regards, Bill -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
As i already mentioned above, i am using 3.0.10 here and the default js library is prototype. But still i am not able make observe_field working. Any ideas? On Jan 8, 8:08 pm, Bill Walton <bwalton...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Venkata, > > On Sun, Jan 8, 2012 at 1:57 AM, venkata reddy <venkatareddy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi every one, > > i need something like populating all the states > > when a particular country selected. My exact requirement is, in my > > project management tool, when a project is selected all of its > > activities should be populated in the next drop down. I think before > > rails 3 it can be done using observe_field tag. But how to do that in > > rails 3 ( 3.0.10 to be precise) . > > AFAIK, the ''observe...'' helpers have not been replicated for jquery ( > I miss them, too) so the easiest way is to swap out jquery and use > prototoype.js. jQuery is now the default, but you can continue to use > prototype.js if you like. > > Best regards, > Bill-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sun, Jan 8, 2012 at 11:40 AM, venkata reddy <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> As i already mentioned above, i am using 3.0.10 here and the default > js library is prototype. But still i am not able make observe_field > working.Missed that. Sorry. In that case I''d need to know more about what ''not working'' means. You might want to start by looking at the page source. Is the ajax code there? If so, is its url pointing to the action you expect it to be pointing to? Using Firebug (you can''t do much debugging of ajax without it), when the field changes is the ajax firing and generating the expected post in the console? If you haven''t already, put some logging in the controller action. Is it getting fired? With the expected parameter(s)? Etc... HTH, Bill -- 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.
I am getting this error, when tried to access the form. NoMethodError in People#new Showing /home/local/PENNYWISE/venkatab/Desktop/rails/dynalists/app/ views/people/_form.html.erb where line #26 raised: undefined method `observe_field'' for #<#<Class:0x007f511c403ed0>: 0x007f511c347cd0>Extracted source (around line #26): 23: <%= f.label :state_id, "state" %><br />24: <div id"states_div">25: <%= f.collection_select :state_id, @states, :id, :name %>26: <%observe_field :person_country_id, :url => { :action => "update_state_div"} , :with => :person_country_id %>27: </div>28: </div>29: <div class="actions">Trace of template inclusion: app/ views/people/new.html.erb i am following this http://thecloudview.com/dynamic-select-lists-with-ruby-on-rails-and-ajax/ , and doing the same.I doubt prototype in rails3 have no method of observe_field. On Jan 8, 11:07 pm, Bill Walton <bwalton...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Sun, Jan 8, 2012 at 11:40 AM, venkata reddy > > <venkatareddy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > As i already mentioned above, i am using 3.0.10 here and the default > > js library is prototype. But still i am not able make observe_field > > working. > > Missed that. Sorry. In that case I''d need to know more about what > ''not working'' means. You might want to start by looking at the page > source. Is the ajax code there? If so, is its url pointing to the > action you expect it to be pointing to? Using Firebug (you can''t do > much debugging of ajax without it), when the field changes is the ajax > firing and generating the expected post in the console? If you > haven''t already, put some logging in the controller action. Is it > getting fired? With the expected parameter(s)? Etc... > > HTH, > Bill-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
looking at http://apidock.com/rails/v2.3.8/ActionView/Helpers/PrototypeHelper/observe_field i thinkt that method is opt out on 2.3.8 maybe http://railscasts.com/episodes/88-dynamic-select-menus there is a revised version, but it''s for subscriber only Ahmy Yulrizka On Mon, Jan 9, 2012 at 5:02 PM, venkata reddy <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> observe_field-- 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.
looking here solved my problem. http://gregmoreno.ca/rails-3-upgrade-part-4-prototype-helpers-and-javascript/ I think observe_field is a good method to be included. Can''t understand why it''s not there. Thank you all! On Jan 9, 3:18 pm, Ahmy Yulrizka <ahmy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> looking athttp://apidock.com/rails/v2.3.8/ActionView/Helpers/PrototypeHelper/ob... > > i thinkt that method is opt out on 2.3.8 > > maybehttp://railscasts.com/episodes/88-dynamic-select-menus > > there is a revised version, but it''s for subscriber only > > Ahmy Yulrizka > > On Mon, Jan 9, 2012 at 5:02 PM, venkata reddy <venkatareddy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: > > > > > > > > > observe_field-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
observe_field was deprecated as rails 3 is towards being javascript agnostic and requires the developer to have a good grasp of javascript. http://www.simonecarletti.com/blog/2010/06/unobtrusive-javascript-in-rails-3/ On Jan 9, 9:49 pm, venkata reddy <venkatareddy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> looking here solved my problem. > > http://gregmoreno.ca/rails-3-upgrade-part-4-prototype-helpers-and-jav... > > I think observe_field is a good method to be included. Can''t > understand why it''s not there. > Thank you all! >-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
K.M. wrote in post #1040052:> observe_field was deprecated as rails 3 is towards being javascript > agnostic and requires the developer to have a good grasp of > javascript. > http://www.simonecarletti.com/blog/2010/06/unobtrusive-javascript-in-rails-3/+1 I also agree with the deprecation, and ultimate removal, of the observe_field helpers. The same behavior can be duplicated with jQuery. Rails should not include helpers that are tightly bound to any specific JavaScript library. -- 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-/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 Sun, Jan 8, 2012 at 1:27 PM, venkata reddy <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> Hi every one, > i need something like populating all the states > when a particular country selected. My exact requirement is, in my > project management tool, when a project is selected all of its > activities should be populated in the next drop down. I think before > rails 3 it can be done using observe_field tag. But how to do that in > rails 3 ( 3.0.10 to be precise) . > > Hi venkat >http://puneetitengineer.wordpress.com/2008/06/01/ruby-on-rails-auto-select/ This might be helpful to u... -- 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.