There is a Session
model with a One-to-Many relationship with Suggestions
, i.e. offers. The session has a lot of suggestions. Made a separate page list_sug.html.haml
, in which there is a list of all the proposals for this session. Made for convenience. But I can not get on this page. In routes.rb
registered:
resources :sessions do get :list_sug end
In show.html.haml
added the following line to session
:
= link_to session_list_sug_url(:session_id => @session.id)
In the controller added:
def list_sug @session = Session.find(params[:session_id]) end
And the problem is that on the session page below the link is lit
http://127.0.0.1:3000/sessions/2/list_sug
at the same time, if you hover / click on it, it goes to /sessions/2
, and if you manually enter the above link, it gets to the desired page with suggestions. Why is this happening and how can it be corrected?