?
Solved

Ruby Rails form

Posted on 2014-04-04
4
Medium Priority
?
290 Views
Last Modified: 2014-04-08
I have an empty form into a link.  That is instead of having a button initiate a get request, do it with a link.

The form looks like this:

<%= form_tag somethpath(@data), method: get, :remote => true, :'data-attr' => @data.id do %>
  <%= submit_tag "Search" %>
<% end %>

Is there an equivalent way to do this using link_to ?
0
Comment
Question by:lcor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 10

Expert Comment

by:Andrew Doades
ID: 39980136
Do you want to replace the submit button with a link_to link?
0
 

Author Comment

by:lcor
ID: 39983465
yes
0
 
LVL 10

Assisted Solution

by:Andrew Doades
Andrew Doades earned 2000 total points
ID: 39983480
You'll have to use JavaScript for this then

<%= link_to 'Save', "#", :onclick=>"$('.search_form').submit()" %>

Open in new window

0
 
LVL 10

Accepted Solution

by:
Andrew Doades earned 2000 total points
ID: 39983484
<%= link_to 'Search', "#", :onclick => "$('#form_id').submit()" %>
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question