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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:36:44+00:00 2026-06-11T02:36:44+00:00

<%= link_to Next week, /?week_forward= %> <% if week_number % 52 == 0 %>

  • 0
<%= link_to "Next week", "/?week_forward= %>
<% if week_number % 52 == 0 %> 
    2 
<% else %> 
    1
<% end %>
<%= + #{(params[:week_forward].to_i || 0)}" %>

I am trying to get this in my html.erb. I’m really not sure what is wrong, are my quotation marks wrong?

Here is the error

bad URI `/?week_forward=%20);@output_buffer.safe_concat('');%20if%20week_number%20%%2052%20==%200%20%20@output_buffer.safe_concat(''2'');%20else%20%20@output_buffer.safe_concat(''1'');%20end%20@output_buffer.append=%20(%20+%200'.
  • 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-11T02:36:46+00:00Added an answer on June 11, 2026 at 2:36 am

    You’re not using link_to properly; the week number 1 or 2 needs to be part of the 2nd argument, not appended after the call to link_to.

    <%= link_to "Next week", "/?week_forward=%d" % (week_number % 52 == 0) ? 2 : 1 %>
    

    Your link_to is going to create the following (once you fix the close quote after "/?week_forward=)

    <a href="/?week_forward=">Next Week</a>1
    

    when you appear to want something like

    <a href="/?week_forward=1">Next Week</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm trying to get a remove link next to the caption in an
I have this line below that shows a link to go the next page
I have this <%= link_to_remote Next, {:url => { :controller=>:objects, :action=>:filter_recent, :page=>@objects.next_page}, :with =>
I have this HTML manual that gets installed with my application. This manual gets
I'm trying to paginate a model using kaminari (0.13.0), but I can't get the
I want to customize next/previous posts links pagination to this structure: <!--PAGINATION--> <a href=#prev_post_link#
I am trying to create dynamic next and previous buttons with javascript. I am
I'm attempting to align the text next to the checkbox on this page, however
Next week I am getting an exam on using basic commands and shell scripting
I'm trying to add Prevous/Next links in my show view. Here is the model:

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.