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@googlegroups.com.
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.

Search Discussions

  • Bill Walton at Jan 8, 2012 at 3:09 pm
    Hi Venkata,
    On Sun, Jan 8, 2012 at 1:57 AM, venkata reddy 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@googlegroups.com.
    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.
  • Venkata reddy at Jan 8, 2012 at 5:40 pm
    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 wrote:
    Hi Venkata,
    On Sun, Jan 8, 2012 at 1:57 AM, venkata reddy 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@googlegroups.com.
    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.
  • Bill Walton at Jan 8, 2012 at 6:07 pm

    On Sun, Jan 8, 2012 at 11:40 AM, venkata reddy 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@googlegroups.com.
    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.
  • Venkata reddy at Jan 9, 2012 at 10:02 am
    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 wrote:
    On Sun, Jan 8, 2012 at 11:40 AM, venkata reddy

    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@googlegroups.com.
    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.
  • Ahmy Yulrizka at Jan 9, 2012 at 10:18 am
    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 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@googlegroups.com.
    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.
  • Venkata reddy at Jan 9, 2012 at 10:49 am
    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 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 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@googlegroups.com.
    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. at Jan 9, 2012 at 11:04 am
    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 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@googlegroups.com.
    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.
  • Robert Walker at Jan 9, 2012 at 5:34 pm

    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@googlegroups.com.
    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.
  • Muruga at Jan 10, 2012 at 12:54 pm

    On Sun, Jan 8, 2012 at 1:27 PM, venkata reddy 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@googlegroups.com.
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJan 8, '12 at 7:58a
activeJan 10, '12 at 12:54p
posts10
users6
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2021 Grokbase