All Questions

48
votes
4answers
56003 views

file download link in rails

I would like to give visitors the option to download some pdf. I have tried: <%= link_to "abc", "/data/abc.pdf"%> <%= link_to "abc", "/data/abc.pdf", :format => 'pdf' %> and some v...
4
votes
2answers
3964 views

The better way to pass the foreign_key value to the Rails controller

It's been almost a week since I've began to dig deeper in forms , associations , hashes , symbols... But it seems I cannot solve the puzzle without your help . I am working on a project for displayi...
13
votes
1answers
16471 views

ruby on rails link_to an image

I'm facing the following problem: I have a very small image gallery with image files located in the following directories app/assets/images/locale/thumbs/ app/assets/images/locale/big/ I have to ...
8
votes
2answers
10679 views

Rails 2 to Rails 3 : using link_to instead of link_to_remote (including remote and update)

A quick and easy answer I'm sure. I'm upgrading a Rails project from version 2 to version 3 and replacing a load of the link_to_remote with link_to's as per the Rails 3 update. Even something as simp...
50
votes
5answers
53101 views

Using Rails link_to for links that post

I have a link that I need to submit a post request with. Normally, I'd use jQuery and prevent the link's default behavior and then submit a form to the destination. This seems like something Rails sho...
20
votes
7answers
26072 views

link_to delete url is not working

I have the following link_to delete url in my app <%=link_to "Delete",blog_path(@blog.id), :method => :delete, :class => "delete", :confirm => "Are you sure ?"%> It does not seem t...
86
votes
2answers
71658 views

"render :nothing => true" returns empty plaintext file?

I'm on Rails 2.3.3, and I need to make a link that sends a post request. I have one that looks like this: =link_to( 'Resend Email', {:controller => 'account', :action => 'resend_confirm_email'...
33
votes
4answers
21234 views

RAILS link_to external site, url is attribute of user table, like: @users.website

I'm working on a website that allows users to create an account. One of the attributes when creating a user is a users personal website. When I try to use the users website like this: <%= link_to ...
9
votes
5answers
16964 views

How to use the link_to helper to open a popup?

I just want to use link_to to open a popup. I tried something but it doesn't work: <%= link_to 'Create a new company', new_company_path, :popup => ['create_company', ...
9
votes
4answers
10643 views

Why Rails "link_to" does not work for delete action?

In index.html.erb I display all products, and next to each product I have Edit and Delete actions: <% @products.each do |product| %> ... <%= link_to("Edit", edit_product_path(product.id)...

Previous Next