1-我想传递项目ID以检索链接到该项目的文件,但我无法传递参数,它说:
No route matches {:controller=>"projects", :action=>"retrieveFiles", :id=>8}
2- Idearly我想留在同一个html页面上,只是填充一个文本区域,例如..
任何想法? :) 感谢
的routes.rb
get 'Projects/RetrieveFiles/:id'
Projects_Controller
def retrieveFiles
@files = Project.find(params[:id]).pfiles
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @files }
end
end
show.rb
<%= link_to 'Edit', edit_project_path(@project) %> |
<%= link_to 'Back', projects_path %> |
<%= link_to 'RetriveFiles', :controller => 'projects', :action => 'retrieveFiles' , :id => @project.id %>
答案 0 :(得分:0)
我认为路线区分大小写,旅程>
get 'projects/retrievefiles/:id'