Anyone have any idea why I’m getting this error when using the block
form of the link_to helper in Rails 2.0.1? I’m essentially using the
exact same code as in the Rails doc example, but no luck. Any help
would be appreciated.
Sorry, meant link_to_function, not link_to.
Could you show us the exact code you’re using please?
On Dec 11, 2007 1:31 PM, bigbanger [email protected] wrote:
Sorry, meant link_to_function, not link_to.
On Dec 10, 6:53 pm, bigbanger [email protected] wrote:
Anyone have any idea why I’m getting this error when using the block
form of the link_to helper in Rails 2.0.1? I’m essentially using the
exact same code as in the Rails doc example, but no luck. Any help
would be appreciated.
–
Ryan B.
Ryan,
I’m using the following code in my .rhtml file:
<%=
link_to_function(“show”, nil, :id => “more_link”, :class =>
“expand_collapse”) do |page|
page[:user_listings].visual_effect :toggle_appear
page[:more_link].replace_html “hide”
end
%>
I should have mentioned that ‘user_listings’ is the id of a div
defined on my page.
I was not aware you could use link_to_function as a block.
It has something to do with your :toggle_appear custom function at a
guess.
link_to_function(“show”, nil, { :id => “more_link”, :class =>
“expand_collapse” } )
On Dec 11, 2007 1:53 PM, bigbanger [email protected] wrote:
link_to_function("show", nil, :id => "more_link", :class =>
On Dec 11, 2007 1:31 PM, bigbanger [email protected] wrote:
would be appreciated.
–
Ryan B.http://www.frozenplague.net
–
Ryan B.
It’s in the Rails docs here:
ActionView::Helpers::JavaScriptHelper.
Specifically, this part:
“The function argument can be omitted in favor of an update_page
block, which evaluates to a string when the template is rendered
(instead of making an Ajax request first).”
Followed by an example similar to the one I posted.
- It has something to do with your :toggle_appear custom function at a
guess.
AFAIK, there is no toggle_appear visual effect. It’s either toggle, or
appear. Not both.
On Dec 11, 2007 2:09 PM, Ryan B. [email protected] wrote:
block, which evaluates to a string when the template is rendered
link_to_function(“show”, nil, { :id => “more_link”, :class =>
end
would be appreciated.
–
Ryan B.
http://www.frozenplague.net
–
Ryan B.
On Dec 11, 2007 2:04 PM, bigbanger [email protected] wrote:
Followed by an example similar to the one I posted.
On Dec 11, 2007 1:53 PM, bigbanger [email protected] wrote:
On Dec 10, 7:02 pm, “Ryan B.” [email protected] wrote:
form of the link_to helper in Rails 2.0.1? I’m essentially
Ryan B.http://www.frozenplague.net
–
Ryan B.