I have four functions that I pass several parameters to over an ajax call. I build the url with javascript an example of one here:
function submitMake(year,make){
new Ajax.Request('update_model/'+year+'/'+make, { method: 'get'});
}
In my routes.rb I have four different entries set to receive the calls to send to the proper controller. Here is one:
match 'car_infos/update_style/:year/:make/:model', :controller => 'car_infos', :action => 'update_style'
Everything works fine but I was wondering if this is a legit rails 3 way of doing it? If it is not, how should I modify my routes and what would the proper url look like?
Thanks for any input.
It’s fine.
When working at the boundaries with js and ruby, there is not much syntax sugar available.