Quantcast
Channel: Is there a way to get a url for a resource in rails - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by Ryenski for Is there a way to get a url for a resource in rails

Given a resource like @post, url_for will return the path. url_for(@post) #=> "/posts/1"From the console: app.url_for(@post) #=> "http://www.example.com/posts/1"app.post_path(@post) #=>...

View Article



Is there a way to get a url for a resource in rails

If I have a resource such as @post, is there a way to get the url to the path to that resource such as:@post.to_urlurl_for(@post)path_to(@post)@post.to_path...you get the ideal

View Article
Browsing all 2 articles
Browse latest View live




Latest Images