0

I have this in my controller but don't work (when I set redirect_to page1_url works well):

render page1_url

in my routes.rb I have a url path:

get "main/page1"
post "main/page1"
match "page1" => 'main#page1'

when I change render in my controller so

render 'main/page1' 

works well but the images in the view not appear, please help

1 Answer 1

1

You need to specify a name for the route helper using ":as". This will give you the page1_url helper.

 match "page1" => 'main#page1', :as=>"page1"

See: naming routes in the docs

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.