Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7813053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:43:18+00:00 2026-06-02T04:43:18+00:00

I have set up a link_to in a partial (update_dashboard) and it looks like

  • 0

I have set up a link_to in a partial (update_dashboard) and it looks like this

link_to "Link", hash, {:url => {:controller => "results", :action => "update_report"}},     :remote => true

‘hash’ is a set of inputs that I am passing to the controller.

As it can be seen. i want the “Link” to map to the ‘update_report’ action in the ‘results’ controller.

but, i find that after the page is rendered, when I click on the link, it just displays the partial in a new page.

I went into Firebug and this is how the link is rendered

<a url="{:controller=>"results", :action=>"update_report"}" href="/test/update_dashboard?branch=xxxx&brand=xx&end_time=2012-02-29+22%3A59&repo=xxxx%2Fxx&start_time=2012-02-17+18%3A20">Link</a>

Why is the href pointing to /test/update_dashboard ? Why is is not taking the parameter that i supplied for the controller attribute

Any help is greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T04:43:20+00:00Added an answer on June 2, 2026 at 4:43 am

    Take a look at link_to method source at: https://github.com/rails/rails/blob/master/actionpack/lib/action_view/helpers/url_helper.rb#L236

    Since ‘hash’ variable is a real hash with keys and values you need to merge it with url hash like this:

    <% hash = { :param1 => "value1", :param2 => "value2"}  %>
    <%= link_to 'MyLink', { :controller => "questions", :action => "index" }.merge(hash), :id => "link_id", :class => "link_class" %>
    

    It produces the link you want:

    <a href="/questions?param1=value1&amp;param2=value2" class="link_class" id="link_id">MyLink</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my issue lokks similar to this one: (link) but i have one-to-many association: <set
I have an ajax action link which is appending a partial to a div.
In my main CSS file, I have my a:link selector set to display links
I have an animation set to slide a DIV down when the DOWN link
I have a discussions controller for which I would like to have an edit
I have my main view like this: <%@ Page Title= Language=C# MasterPageFile=~/Views/Shared/Site.Master Inherits=System.Web.Mvc.ViewPage %>
I have set a link to some text using tinymce.execCommand(CreateLink, False, theLink) . The
I have set up an comment button that is link to comment section of
I have set up multiple targets in a single xml file. I expect all
I have set up 2 servers which are linked. From my LOCAL SERVER, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.