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 6712167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:13:39+00:00 2026-05-26T08:13:39+00:00

I want to create a link_to render :partial . I have two partials stored

  • 0

I want to create a link_to render :partial. I have two partials stored already in the view folder in which I call the link_to (which is the profiles views). Getting the JavaScript to load the data is the next step but I am having trouble structuring the link_to properly.

Here’s what I had:

<ul id="infoContainer">
  <li><%= link_to render(:partial => "about") do %>About<% end %></li>
  <li><%= link_to render(:partial => "other") do %>Other<% end %></li>
</ul>

Using these, both partials rendered in my show.html.erb and the links disappeared.

So I tried the following:

<ul id="infoContainer">
  <li><%= link_to render(:partial => 'about'), :class => "a", :remote => true do %>About<% end %></li>
  <li><%= link_to render(:partial => 'other'), :class => "o", :remote => true do %>Other<% end %></li>
</ul>

Both partials still show and the “About”/”Other” text links still don’t show.

UPDATE: So I may have the link_to working. It’s just not rendering anything. Gotta fix that with JavaScript I assume.

<li><%= link_to "About", (:partial => 'about'}, {:class => "a"}, :remote => true %></li>
<li><%= link_to "Other", (:partial => 'other'}, {:class => "o"}, :remote => true %></li>

Using the link_to above makes the URL: /profiles/1?partial=about

  • 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-05-26T08:13:40+00:00Added an answer on May 26, 2026 at 8:13 am

    you’re using link_to incorrectly — please check the API / docs

    it’s called either:

    link_to(body, url, html_options = {})
      # url is a String; you can use URL helpers like
      # posts_path
    
    link_to(body, url_options = {}, html_options = {})
      # url_options, except :confirm or :method,
      # is passed to url_for
    
    link_to(options = {}, html_options = {}) do
      # name
    end
    
    link_to(url, html_options = {}) do
      # name
    end
    

    See:

    http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to

    http://apidock.com/rails/ActionView/Helpers/UrlHelper/link_to

    and perhaps:

    link_to syntax with rails3 (link_to_remote) and basic javascript not working in a rails3 app?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a link_tag in view which add rendered content to page link_to("add",nil,:id=>"create_row_cycle",:onclick=>"$('div#cycle_form table').append('#{escape_javascript(render(:partial=>'cycles',
On confluence I want to create a link that links to: P:\myFolder\folder, where P
I have a requirement in sharepoint where I want to Create the top link
i want create image animation , i have 50 images with png format now
I have a series of images that I want to create a video from.
I want to render a view when user clicks on Add New button on
I using jQuery and have the following code, it's a partial and I want
So I am trying to render a partial view into my page and I
I have a User entity, and in various views, I want to create links
I want to create a link like this: <a href=http://example.com>text</a> and replace the behavior

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.