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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:51:07+00:00 2026-05-29T03:51:07+00:00

I am developing a project with rails 3.1.3 and kaminari 0.13.0. I have two

  • 0

I am developing a project with rails 3.1.3 and kaminari 0.13.0. I have two models Article and Comment. Article has many Comments. My controllers are ArticlesController which basically does everything except for creating comments. This is handled by CommentsController. In my view for ‘articles#show’ I have a form to crate new comments. I want this form to be submitted remotely (:remote => true). I have a list of comments right bellow it which is paginated with kaminari. Naturally, I want the list to be refreshed. However as the comment is submitted to ‘comments#create’, the pagination links become incorrect when rerendered. I tried to add <%= paginate @comments, :params => { :controller => "articles", :action => 'show' } %> to make them point to the right url, however this didn’t solve my problem. When the list is rerendered, I receive:

ActionView::Template::Error (No route matches 
{:utf8=>"✓",:authenticity_token=>"5VJqDLifXX0O/ttq9rNY0POUbsN678I6Au2iL2Qcv7w=",
 :comment=>{"name"=>"4004053","content"=>"asdf"},:commit=>"Create Comment",
 :action=>"show",:controller=>"articles",:article_id=>"4f24fbb4f4b7b863a4000009",
 :page=>nil}):

I can solve this by adding extra attribute to paginate and make it <%= paginate @comments, :custom_url => "/articles/#{@article._id}" %>. Then I can change kaminari’s views to set the url to my custom_url if it is there. However I don’t like very much the idea.

Am I missing something? Is there a better way to do this?

Thank you in advance!

  • 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-29T03:51:08+00:00Added an answer on May 29, 2026 at 3:51 am

    It turned out that

    <%= paginate @comments, :params => { :controller => "articles", :action => 'show' } %>
    

    almost worked, however I needed to add :id => @article.id so it became

    <%= paginate @comments, :params => { :controller => "articles", :action => 'show', :id => article.id } %>
    

    Quite stupid mistake, I see now. I didn’t understand the routing enough.

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

Sidebar

Related Questions

I'm developing a rails project where I have one data model with multiple fields
We now are developing one Rails project and we have binary files served by
I'm developing a project using Rails 3.2. In the project I have a controller
I am developing project using MVVM pattern.In the project I have two viewmodel namely
Developing a project of mine I realize I have a need for some level
I am developing a project which works with multiple arithmetic types. So I made
I'm developing a project that has a number of hardware sensors connecting to the
I have a Google Chart's ColumnChart in a Rails project. This is generated and
i have developing project in c# for creating a user in AD. i create
I'm developing this project for a device (let's say) 'Prototype X' and it has

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.