Hi Hassan,
I am Bit of a novoice to this...... iam nt sure wether this is correct
approach...in my application.js file i have wriiten
$(document).ready(function() {
$("#client_country_id").change(function() {
$.ajax({
type: "GET",
url: '/states/1',
success: function(data) {
// Code
}
});
});
});
and my clients form has state feidl like this
<div class="field row odd">
<%= f.label :state1 %>
<%= f.select 'state_id', State.find(:all).collect{|s|
[s.name,s.id]} %>
</div>
now i want to pass the country id and ftecth state depending on
it..... do i include the above div in a prtial and what to write in
the state controller.....
Thanks in advance.
Thanks & Regards,
On May 2, 7:14 pm, Hassan Schroeder <hassan.schroe...@gmail.com>
wrote:
> On Wed, May 2, 2012 at 7:06 AM, akshar jamgaonkar
>
> <akshar.jamgaon...@gmail.com> wrote:
> > i have gone through this but it has an example where Javascript has been
> > used , i want to use AJAX and JQuery,
>
> So what's the problem? What have you tried so far, and how did it
> not work?
>
> --
> Hassan Schroeder ------------------------ hassan.schroe...@gmail.comhttp://about.me/hassanschroeder
> twitter: @hassan
--
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.
No comments:
Post a Comment