Forum: Ruby on Rails pass name and values in link_tag

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
rajesh kanna (Guest)
on 2013-07-29 17:03
(Received via mailing list)
hi i passed name and value in link_to but its not taking?

<%if params[:deals][:company_name] !=nil &&
== "dsec" %>
            <%= link_to "Company Name
            <%elsif params[:deals][:company_name] !=nil &&
params[:deals][:company_name] == "asc"%>
            <%= link_to "Company Name
"data-url"=>"1","data-searchurl"=>"/deals/search" %>
            <%= link_to "Company Name n","javascript:void(0)",:
dsec","data-url"=>"1","data-searchurl"=>"/deals/search" %>

in browser
<a class="get_page" value="dsec" name="deals[company_name]"
data-url="1" data-searchurl="/deals/search"
Name n</a>

how to pass name and value to link_to tag?

Matt Jones (Guest)
on 2013-07-30 15:46
(Received via mailing list)
On Monday, 29 July 2013 11:01:32 UTC-4, kanna wrote:
>             <%= link_to "Company Name a","javascript:void(0)",:class=>"get_page
> <a class="get_page" *value="dsec" name="deals[company_name]"* data-url="1"
data-searchurl="/deals/search" href="javascript:void(0)">Company
> Name n</a>
The values appear in the link tag, just as you requested. Perhaps you're
intending to pass them as parameters to /deals/search somehow?

To help people answer this question, you should include the Javascript
that's reading data-url and data-searchurl so that it can be determined
exactly what that code is looking for...

--Matt Jones

PS: multiple-posting your question is not generally considered a useful
to produce answers faster. :)
rajesh kanna (Guest)
on 2013-07-30 19:08
(Received via mailing list)
hi Bryan
its not coming.

This topic is locked and can not be replied to.