我的应用程序有问题,当我将路径 student_postulations_path 放在导航栏中时崩溃:S。
我在我的route.rb
resources :students do
resources :postulations
end
我的应用程序说这个错误
No route matches {:controller=>"postulations"}
我的观点
<% elsif student_signed_in? %>
<% menu_group :pull => :right do %>
<%= menu_item "Postulaciones", student_postulations_path %>
<%= menu_divider %>
<%= drop_down current_student.email do %>
<%= menu_item "Logout", destroy_student_session_path, :method => :delete %>
<% end %>
<% end %>
<% else %>
当我使用 rake 路线时:
student_postulations GET /students/:student_id/postulations(.:format) postulations#index
POST /students/:student_id/postulations(.:format) postulations#create
new_student_postulation GET /students/:student_id/postulations/new(.:format) postulations#new
edit_student_postulation GET /students/:student_id/postulations/:id/edit(.:format) postulations#edit
student_postulation GET /students/:student_id/postulations/:id(.:format) postulations#show
PUT /students/:student_id/postulations/:id(.:format) postulations#update
DELETE /students/:student_id/postulations/:id(.:format) postulations#destroy
我的模特学生和假设:
class Student < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me, :nombre, :rol,
:prioridad, :resumen, :categoria, :foto
# attr_accessible :title, :body
has_many :postulations
end
class Postulation < ActiveRecord::Base
attr_accessible :status, :student_id
belongs_to :student
end
我不明白我的错误......我的事情没问题。请帮忙!:)。
谢谢