SoWhat
SoWhat

Reputation: 5622

How do I get the url to a path in ruby

I am using <%=link_to "Add fund",addFund_item_path(:id=>item.id),:class=>"addfund btn btn-primary"%>" to generate a link to a path in rails.

I want to get only the url (the href) of the path so I can use it in a form. How do i do that?

Upvotes: 0

Views: 66

Answers (2)

dax
dax

Reputation: 11007

So you just want the actual href? I would do this:

<%= content_tag "a", addFund_item_url %>

It won't be a 'link' per se - it will be clickable, but won't go anywhere - but it will show the full href path

Upvotes: 0

Danil Speransky
Danil Speransky

Reputation: 30473

Just addFund_item_path(:id=>item.id).

Upvotes: 1

Related Questions