Hi all,
The below link is not directing to media_files_list function but
directing to the show function. Please help, i want to direct it to
media_files_list function.
In controller i declared…
def media_files_list
Please note: i want to use get-method as below.
<a onclick=“new Ajax.Request(’/media_files/media_files_list’,
{asynchronous:true, evalScripts:true, method:‘get’,
onSuccess:function(request){handleData(request,“centernav”)},
parameters:‘module_id=MENU09041512&upload_list=true&page=2’ +
‘&authenticity_token=’ +
encodeURIComponent(‘s5Tjz5cJJl28uR0OGMbALzbh8ktwLkL2+fVjPBruqmk=’)});
return false;” href="#">2
Provide the actual line of code
Rails L. wrote:
Provide the actual line of code
<%= link_to_remote page_no,
:success =>‘handleData(request,“centernav”)’,
:url => {
:action => params[:action],
:controller =>params[:controller]
},
:with =>
“‘module_id=#{module_id}&upload_list=true&page=#{page_no}’”,
:method => :get
%>
<% end %>
Venkat E. wrote:
Rails L. wrote:
Provide the actual line of code
<%= link_to_remote page_no,
:success =>‘handleData(request,“centernav”)’,
:url => {
:action => params[:action],
:controller =>params[:controller]
},
:with =>
“‘module_id=#{module_id}&upload_list=true&page=#{page_no}’”,
:method => :get
%>
<% end %>
dude
i think you have written this code in your show.html.erb and because of
that params[:action] is going to return “show” that why your request
is going to show action instead of
def media_files_list
used something like this
<%= link_to_remote page_no,
:success =>‘handleData(request,“centernav”)’,
:url => media_files_list_[“your controller name”]_path(parameter)
:with =>
“‘module_id=#{module_id}&upload_list=true&page=#{page_no}’”,
:method => :get
%>
<% end %>
this should work
do rake routes for more information
controller name can be singular or plural based on the definition of
your methods defined in your route.rb