Questions tagged [button-to]
67 questions
1
vote
2 answers
Form_tag link to page in another folder
I am integrating 2 rails projects using button to link the first project to the second. Now I have this code
<%= form_tag fast_url_for(' ') do %>
<%= button_to AppConfig.app_clockout %>
<% end %>
and my current directory…

skyranch
- 55
- 5
1
vote
3 answers
How to open a link in a new window with ruby?

Alexander Holland
- 21
- 1
- 5
1
vote
1 answer
button_to to render pdf format
In my controller I have the action:
def booking_sheet_report
@groups = Group.all.order('priority DESC')
respond_to do |format|
format.html
format.csv
format.pdf
end
end
and in the view I want the user to be able to open (download)…
user2911232
1
vote
1 answer
Rails 4: button_to not submitting params
I am trying to get the following to work -
Basically, the button submits to the searches_controller index action and SHOULD pass the params[:search_task] to it. But for some reason its not working.

GhostRider
- 2,109
- 7
- 35
- 53
1
vote
1 answer
remote true on button_to not makes ajax call
I am doing a small rails app.
I am trying to make an ajax call.
Despite I use remote: true the button_to is making a non ajax request. It redirects me to this url http://localhost:3000/lines?product_id=1
<% @products.each do |product| %>
<%=…

Gerard Morera
- 799
- 6
- 12
1
vote
1 answer
Input new record into database using a form with the association belongs_to
I’m relatively new to ruby on rails so bear with me.
I'm trying to create an app where there are many Projects with specific Issues associated to each project. The following is my code:
My Models:
class Issue < ActiveRecord::Base
belongs_to…

Mais
- 29
- 7
1
vote
1 answer
Use button_to for external link via GET
As a test, I used both link_to and button_to, but only the former is working. With the latter, it looks like the params are just not passed, because I get an error from Facebook saying there's no client_id when there certainly is in the URL.
link_to…

james
- 3,989
- 8
- 47
- 102
1
vote
0 answers
Struggling with Rails button_to calling a controller action and redirecting to another view
I'm struggling out with the Rails button_to.
Essentially, I'm implementing something like a food diary, to keep track of the calories, proteins, etc of the food a user takes in a day. I have my nutrition page in which the user clicks on add item.…

RodMal
- 11
- 4
1
vote
1 answer
Ruby on Rails - button_to using routes to call function from controller
Hello right now I've a problem about button_to
I want to setup a button that call a method in controller, this is how I setup the button :
(this located in issues/_edit.html.erb)
<%= button_to "Cancel Return", :action => "cancel_return", :controller…

Niko Adrianus Yuwono
- 11,012
- 8
- 42
- 64
1
vote
2 answers
How to disable the button_to on rails when I click on button?
I have a button on my Ruby on Rails app which calls a function on my controller.
When I click on the button I call a function.
So I want do disable this button after clicking on it, then able it again after my function was done.
How can I do…

kamusett
- 1,403
- 1
- 12
- 22
1
vote
1 answer
How I create a non-visible button in rails using a boolean condition
So. I'm in a loop
<% products.each do |product|%>
btn_hide = "btn-hide-class"
<%= button_to "expired",
method_path(@path),
method: "get",
class: "btn btn-expired-supply…

Andrés Zorrilla
- 101
- 11
1
vote
1 answer
Passing an array of IDs to button_to in Rails?
Is there a way to pass an array of object IDs through button_to? I want the ID passed to controller in an array format so that it'll be the same format as if the user decides to select several items and click one submit button. On the page, there…

sweetandsour
- 11
- 1
1
vote
1 answer
button_to remote update
I am attempting to use the button_to helper to remotely update my database, though i am having a few issues, where it doesnt seem to be passing the params.
within my view i am using
- @availabilities.each do |a|
=button_to 'Accept', {…

Boss Nass
- 3,384
- 9
- 48
- 90
1
vote
1 answer
Delete icon doesn't do confirm dialog
I can't the "confirm" dialog to come up. The record gets deleted ok and the page is updated, but no confirm dialog :(
= button_to('- - -', sched_set_path(sched_set_id),
:confirm => 'Are you sure you want to delete this schedule?',
:method =>…

Michael Durrant
- 93,410
- 97
- 333
- 497
0
votes
3 answers
"Are you sure?" confirmation popup not showing for Delete button, Rails 7
When admins click the "Delete park" button, I want an "Are you sure?" confirmation dialogue to pop up before the park is deleted.
I've read lots of other people using Rails 7 had success by adding the confirm message to form, like this:
<%…

Rebecca
- 88
- 1
- 9