Forum: Ruby on Rails link_to problem

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
B4dd4eeca52374dc0c5cfe9712b87549?d=identicon&s=25 Guest (Guest)
on 2006-12-25 06:12
Hi, I've got an issue that I'm running into when I try to display a new
month in a calendar program I'm working on. I have a view show_month and
in that view there are a couple of links, one to the previous month and
one to the next month. They look more or less like this:

<%= link_to 'Next Month' :action => 'show_month', :m => ( @month + 1),
:yr => @year %>

Where @month and @year are instance variables defined in show_month and
passed to the view. I know they're being used because I use @month and
@year in other parts of the view, so that's not the issue. The issue is
that the link_to thingy is not passing the values :m and :yr to
show_month at all, and I'm at a total loss as to how to get that to
work. I've tried this several different ways, too, without any luck. Any
help would be appreciated. Thanks!
2b891e820c238ded365d035771603f21?d=identicon&s=25 Bill Walton (Guest)
on 2006-12-25 17:17
(Received via mailing list)
Guest wrote:

> <%= link_to 'Next Month' :action => 'show_month', :m => ( @month + 1),
> :yr => @year %>

> <%= link_to 'Next Month', {:action => 'show_month', :m => ( @month + 1),
> :yr => @year} %>

The link_to documentation at explains it
well, I think.

This topic is locked and can not be replied to.