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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:16:33+00:00 2026-06-01T18:16:33+00:00

I have the following tag partial %span.tag-label = link_to #{tag} , :controller => searches,

  • 0

I have the following tag partial

%span.tag-label
  = link_to "#{tag}"  , :controller => "searches", :action => "search_tags", :search_type => search_type,
  :tag_type => tag_type, :tag =>"#{tag}"

and I pass tags to the partial as collection:

= render "shared/tag_item", :collection => @listing.keyword_list, :as => :tag, 
:search_type => "Listing", :tag_type => nil

For some reason, I got this error:

wrong number of arguments (0 for 1) 

in my partial.

If I just put plain text on link_to "text" and :tag =>"text" then it works.
Why my embedded text in "#{tag}" doesn’t work in this case?

Thank you.
Update Show error trace:
`endered listings/show.html.haml within layouts/application (148.4ms)
Completed 500 Internal Server Error in 232ms

ActionView::Template::Error (wrong number of arguments (0 for 1)):
    1: %span.tag-label
    2:   = link_to "#{tag.to_s}"  , :controller => "searches", :action => "search_tags", :search_type => search_type,
    3:   :tag_type => tag_type, :tag =>"#{tag.to_s}"
  <a href="txmt://open?url=file:///Users/app/views/shared/_tag_item.html.haml&amp;line=2&amp;column=1">app/views/shared/_tag_item.html.haml
  • 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-01T18:16:34+00:00Added an answer on June 1, 2026 at 6:16 pm

    When passing local variables to your partial, you have to pass the render method the key :locals.

     render "shared/tag_item", :collection => @listing.keyword_list, :as => :tag, :locals => { :search_type => "Listing", :tag_type => nil }
    

    Though I have to admit, I would have expected this to give a NameError and not an ArgumentError. Do a search_type or tag_type method exist somewhere in your code?

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

Sidebar

Related Questions

I have the following code in a partial: <%= image_tag(url_for(:controller => campaigns, :action=>'coupon_preview_text', :id
I have following Classes and interfaces.. public interface ITaggable { ICollection<Tag> Tags { get;
I have the following tag with a Html.TextBoxFor expression and I want the contents
In my xhtml page I have the following tag included: <f:view locale=#{languageBean.locale}> ... </f:view>
For example, I have the following tag which its content is short <div>It is
I have the following code: Tag.find_all_by_company_id(4).each.collect{|tag| tag.name }.join(,) (Essentially I'm trying to build a
I have the following Application tag code in my widget: <mx:Application xmlns:mx=http://www.adobe.com/2006/mxml xmlns:local=* width=100%
I have seen some websites use the following tag: <meta type=title content=Title of the
I have the following code: class IncidentTag: def __init__(self,tag): self.tag = tag def equals(self,obj):
I have the following method which serialises an object to a HTML tag. 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.