link-to

Rails jQuery link_to click function issue

Thanks in advanced. So my overall goal is get a modal dialog box with a form in it to pop up. I am running into an issue when I click my link to bring up the modal it doesn't seem to be using javascript ... it just renders the page as if javascript is disabled. Code below :) application.js jQuery(function(){ $("#create_reminder_dial...

Getting a Rails Observer or Sweeper access to link_to OR rendering a view to string from within an Observer

I have a standard rails observer configured: class TipObserver < ActionController::Caching::Sweeper observe Tip def after_save(tip) profile_link = link_to tip.profile.name, profile_path(tip.profile) Profile.followers(tip.quality).each{|profile| message = Message.new message.sender = Profile.first message.re...

Upgrading :with parameter on a link_to_remote in Rails 3

What's the preferred UJS replacement for the Rails RJS helper ':with' parameter on a link_to_remote when upgrading to Rails 3 (using the new unobtrusive link_to... :remote => true syntax). eg. Replacement for: link_to_remote "Ajax Call", example_path(@thing), :with => "'foo=' + $('field').val()" Specifically, I'm looking into a link ...

Rails link_to not automagically using request.format as extension in links

I'm setting request.format = :mobile within an ApplicationController before_filter. before_filter :some_filter def some_filter request.format = :mobile end I have this mapping in routes: map.my_list '/my_list.:format', :controller => "of_no", :action => "significance" When I do the following: <%= link_to "My List", my_list_path...

Ruby on Rails: How to pass parameters from view to controller with link_to without parameters showing up in URL

I am currently using a link_to helper in View to pass parameters like title , author ,image_url and isbn back to controller <%= link_to 'Sell this item',new_item_path(:title => title, :author => authors, :image_url=>image, :image_url_s=>image_s, :isbn=>isbn, :isbn13=>isbn13 ) %> Controller will then assign the parameters to an object ...

link_to_remote and link_to in Rails 3

Hi, I'm a newbie spanish Rails developer. ¿Can u help me with a problem with Rails? I have an application with RoR 2 and Google maps and i catch X and Y coord to send to a controller. I use :with parameter <%= link_to_remote "Obtener datos catastrales", :update => :catastro,:url => {:controller => "instalacions", :action => "catastro_...

Syntax for link_to with block in rails3 with :remote=>true and including :class and :id

For the love of god, I've been banging my head on this for hours. Using rails3 rc, 1.9.2. I'm trying to create a link_to that submits an ajax request, with parameters, a class and id, and needs a block so I can insert a span tag around the name. Documentation is of absolutely zero help, as are numerous google searches. Here's what I've...

link_to :action => 'create' going to index rather than 'create'

I am building a fairly simple recipe app to learn RoR, and I am attempting to allow a user to save a recipe by clicking a link rather than through a form, so I am connecting the user_recipe controllers 'create' function through a link_to. Unfortunately, for some reason the link_to is calling the index function rather than the create. ...

Rails 3's link_to('&raquo;', url) won't work if it is &raquo; or other entities

because it will not show up as » but will show up as &raquo. Is there a way to show it? ...

SEO/Rails - How to add the title tag to every "link_to"

Hey, I'm surprised Rails creator didn't think about that, if someone can help, would be great. How can we do to change this: <%= link_to "My Title", :controller => "products" %> to this automatically: <%= link_to "My Title", :controller => "products", :title => "My Title" #basically a copy of the text %> I think it could help...

named routes with devise in Rails 3 haml view

from rake routes I get this in my application new_admin_session GET /admins/sign_in(.:format) {:controller=>"devise/sessions", :action=>"new"} admin_session POST /admins/sign_in(.:format) {:controller=>"devise/sessions", :action=>"create"} de...

Toggling a single value in a model, all from a link_to

I have an Admin controller for a page of a Rails 3 app that lists all the User model accounts in a table, and part of each row should be a link (with confirmation) to toggle the is_admin attribute of my User model. I would like to do this by allowing an admin to click on text in the table cell that lists the current admin status (i.e. cl...

How to mixin and call link_to from controller in Rails?

This seems like a noob question, but the simple answer is eluding me. I need to call link_to in an ActionController method to spit out an HTML link. ActionView::Helpers::UrlHelper.link_to calls url_for, but this calls the AV module's version instead of the controller's. I managed to coerce this into doing what I intended by putting #...

Add a value to a delete link in Rails?

I currently have the following link_to in my Rails application: <%= link_to 'Remove this Person', @person, :confirm => 'Are you sure?', :method => :delete, :class => 'important', :class => "minimal important" %> I would like to add the person's name in place of the "this person" for the link. I don't appear to be able to do: <%= lin...