ruby on rails - Routes not working on first visit -
i have namespace , added edit , update routes file particular model. problem when visit edit route link_to within app, says no route found, however, if manually come in same url finds , renders page properly. url trying visit coordinator/teacher_recommendation/?/edit
show works fine.
here relevant part of routes file:
namespace :coordinator resources :applicants, :only => [:show, :edit, :update, :index] fellow member 'invite_teachers' set 'create_invitations' end end resources :teacher_recommendations, :only => [:show, :edit, :update] resources :recommendation_reminders, :only => [:create, :new, :update] end end
any ideas on why be?
here button_to link not work:
button_to "send reminder", edit_coordinator_teacher_recommendation_path(@applicant.science_recommendation)
and here link_to work:
link_to "send reminder", edit_coordinator_teacher_recommendation_path(@applicant.science_recommendation)
i changed button_to link have method parameter , seemed take care of problem...
button_to "send reminder", edit_coordinator_teacher_recommendation_path(@applicant.science_recommendation), class: "btn btn-mini", :method => :get %>
ruby-on-rails routes
No comments:
Post a Comment