<%= 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'.
You’re not using
link_toproperly; the week number1or2needs to be part of the 2nd argument, not appended after the call tolink_to.Your
link_tois going to create the following (once you fix the close quote after"/?week_forward=)when you appear to want something like