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

  • Home
  • SEARCH
  • 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 447839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:36:36+00:00 2026-05-12T21:36:36+00:00

I was working on my website when I cam across this problem, I have

  • 0

I was working on my website when I cam across this problem, I have 100 posts in my blog and I am paginating them 10 at a time, I display the 1st 15 and display a link at the bottom which basically is implemented using the link_to_remote tag.

<%= link_to_remote "More Posts", :url => {:action => 'view' ,:id => link.to_i + 1} , :html => {:id => 'more-link'} %>

I click on that and get the next 15 posts, and append it to the container containing the 1st 15 posts through insert_html

page.insert_html :bottom, :puzzles , :partial => 'puzzles', :object => @puzzles

Now what I want is the link at the bottom of the page to update too, so that the next time the user clicks more the 3rd batch is fetched and so on. Basically something like

page.replace_html 'more-link', link_to_remote "More Posts", :url => {:action => 'view' ,:id => link.to_i + 1} , :html => {:id => 'more-link'}

Any clues as to how I can do it?

  • 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-12T21:36:36+00:00Added an answer on May 12, 2026 at 9:36 pm

    You’re very close.

    replace_html is called with (DOM_id, options for render). Essentially you want to render the output of a link_to_remote call. But you’re not passing it in a form that render can use. As Barry Hess points out replace is much better suited for this task, because most of what you’re changing is the tag attributes.

    Using replace_html would result in nested tags which is could cause problems. You want to replace the element entirely. Replace has the same syntax of replace_html so you would run into the same problems if you were just switch replace_html to replace.

    Here’s what you want:

    page.replace 'more-link', :text => link_to_remote "More Posts", 
      :url => {:action => 'view' ,:id => link.to_i + 1} ,
      :html => {:id => 'more-link'}
    

    However I’m not sure if link_to_remote is accessible from RJS. If the above doesn’t work you could always do this:

    page.replace 'more-link', :inline => "<%= link_to_remote 'More Posts', 
      :url => {:action => 'view' ,:id => link.to_i + 1},
      :html => {:id => 'more-link'} %>", :locals => {:link => link}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working on website recently and have come across a major problem :http://jimbob.webatu.com/index.html(you'll
I have a working website, where I use this expression everywhere. price.ToString(C) It currently
So I already have the website working (I'm not working from scratch). The problem
I am working on a website and currently have a UserControl set to display
I have working website in PHP with a MySQL backend which has several tables
I already have a working OOP website. Most of the php is separated from
Im working on a website that is bassed around voting for posts. the website
Copied a working website from one server to another, now I'm getting this error
I already have a working OOP website. Most of the php is separated from
Ok, this is the deal. I just launched a website working on Wordpress where

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.