Displaying 20 results from an estimated 200 matches similar to: "undefined method `link_to'"
2006 Jan 11
5
stack level too deep problem
Hi all, I''m trying to overload the link_to function, (to disable link_to if
the user has no access right)
this is my code, it work the first time I run the application, the second
time I refresh the page I always get "stack level too deep error"
module UsersHelper
include ActionView::Helpers::UrlHelper
alias_method :link_to_original, :link_to
def permission?
true
2006 Mar 25
0
in_place_collection_editor
Hi,
I''m trying to write a helper for Scriptaculous'' InPlaceCollectionEditor
component. I''ve already submitted a patch
(http://dev.rubyonrails.org/ticket/4302). This was a drunk patch; it
needs a bit of work (Don''t drink & code!). So far I''ve gotten it to work
correctly with normal collections, but I want to use it for belongs_to
relations as
2006 May 10
2
session[:return_to] for going back.
Hi,
Is session[:return_to] something Rails maintains to quickly go back to the
previous uri without having to keep track of the action name? Or, do we
have to actually set it in our actions?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060510/7e36a528/attachment.html
2009 Oct 06
1
Problems Processing multiple form elements generated by javascript actions
Hi all,
After many days of struggling, I have a multi-model form with ajax
elements more or less working, but I''m hitting a wall with a few bugs
that I can''t figure out. Guidance would be very much appreciated.
I''m using the Ryan Bates technique from Advanced Rails recipes to
dynamically add and remove elements on a multi-model form.
2006 Mar 13
1
issue with redirect_to
Hi all:
I can''t make redirect_to to unlock the current iframe using {:TARGET =>
"_top"}. It always stays in the current frame. I checked the
redirect_to code, it seems the method does not use "target". here is the
source code of redirect_to from ActionController::Base
def redirect_to(options = {}, *parameters_for_method_reference) #:doc:
753: case options
2010 Aug 09
0
Expanding tests with own methods
I want to call the method ''url_for'' in my functional test.
e.g. assert_select "a[href=?]", url_for(:action => :new), :text => ''Neue
Seite''
The book I am reading suggests doing this:
class PagesControllerTest < ActionController::TestCase
def setup
def self.url_for(options, *parameters_for_method_reference)
options.merge! :only_path
2006 Jul 13
1
From the Agile book, page 144 regarding a div tag helper
Hi. in the Rails Agile book here''s what was happening:
>>>
module StoreHelper
def hidden_div_if(condition, attributes = {})
if condition
attributes["style" ] = "display: none"
end
attrs = tag_options(attributes.stringify_keys)
"<div #{attrs}>"
end
# format_price method ...
end
Note that we cheated slightly here. We copied code from the Rails
2007 Mar 23
1
How does this helper work? (agile book)
Hello,
Im trying to understand how this helper method works:
def hidden_div_if(condition, attributes = {})
if condition
attributes["style"] = "display: none"
end
attrs = tag_options(attributes.stringify_keys)
"<div #{attrs}>"
end
This is how they are calling it:
<%= hidden_div_if(@cart.items.empty?, :id => "cart") %>
2008 Dec 28
1
escape character problem
Hi, i need to construct a link as following
"<a href=\"#{CONFIG[''URLS''][''Xyz'']}\#{url}\"#{tag_options}>#{name ||
url}</a>"
But here due to escape character #{url} not give actual value it
treated as a string. how to solve this ?
if i do
"<a
2006 Aug 03
1
Why doesn''t redirect_to handle rjs?
Is there a good reason why redirect_to doesn''t check responds_to, so
it can handle redirects in rjs calls? I''ve done something like this
in my app controller, seems to work ok...
alias_method :redirect_to_orig, :redirect_to;
def redirect_to(options = {}, *parameters_for_method_reference)
respond_to do |accepts|
accepts.html do
redirect_to_orig
2006 Jun 26
0
Action caching with params
I was attempting to cache an action that had a URL like this:
http://foo.com/controller/action?years[]=2005&years[]=2006&bar=5&baz=blue
which returns different data than, say
http://foo.com/controller/action?years[]=2004&years[]=2005&bar=6&baz=red
However, the cached fragment would always be named
foo.com:3000/controller/action.cache, no matter what parameters where
2006 Mar 12
2
Strange error: undefined method `rewrite''
Hi,
when I generate a new rails project with a simple scaffolded controller,
I get a strange error message, whenever it tries to call the url_for
method, for example:
,----
| undefined method `rewrite'' for #<Url:0xb7675e64>
|
| Extracted source (around line #7):
|
| 4: </p>
| 5: <% end %>
| 6:
| 7: <%= link_to ''Edit'', :action =>
2006 Mar 01
2
In_place_editor in a For loop
I''m using Ajax to create a list of items. Once these items have been
created the user can edit in place and delete them. I''ve got the ajax
working for delete and removing the element from the page, but the
in_place_editor_field doesn''t seem to like being in a for loop. I''ve
got in_place_editor working for single items, but what''s the syntax
2005 Oct 25
2
generate scaffold ignores controller parameter
Since I upgraded from Rails 0.13.1 to 0.14.1 "generate scaffold <Model>
<Controller>" doesn''t take any notice of the controller parameter. Anyone
else suffering from this? E.g.:
C:\Ruby\work\test>ruby script\generate scaffold User Admin
exists app/controllers/
exists app/helpers/
create app/views/users
exists test/functional/
2011 Apr 08
5
How to extend a helper using plugin?
Hello,
I''m facing this problem while trying to extend the parse_redmine_links
helper method in Redmine-1.1.0 (Rails-2.3.5) from my plugin.
My idea is to use alias_method_chain so the extended version could
call the original version and adjust the result to it''s liking.
Anything I''ve tried so far exposes this behavior: the first render of
a page uses the extended
2006 Feb 21
1
OT Proftpd Continued
Below is a cut and past from my log files that are sent to me. This is
from the last day that proftpd worked correctly. I'm not sure why
proftpd was restarted as the log states:
################### LogWatch 5.2.2 (06/23/04) ####################
Processing Initiated: Sun Feb 19 09:02:02 2006
Date Range Processed: yesterday
Detail Level of Output: 0
Logfiles
2006 Jan 03
1
Passing parameters with link_to
I have following code in my controller:
class AlbumsController < ApplicationController
def list_by_year(year)
@album_pages
@albums = paginate :albums,
{ :per_page => 10,
:conditions => ["year = ?", year] }
render :action => ''list''
end
end
Now I want to make a link to the list_by_year action in
2008 Jul 14
1
question about method "hidden_div_if" in AWDR 2
I followed the sample code in AWDR 2 like this:
store_helper.rb
def hidden_div_if(conditions, attributes = {})
if conditions
attributes["style"] = "display:none"
else
attr = tag_options(attributes.stringify_keys)
"<div #{attr}>"
end
end
store.html.erb
<%= hidden_div_if(@cart.items.empty?, :id => "cart") %>
<%=
2012 Nov 06
2
rspec failure upon revisit
I just returned from a different project after taking a few weeks off of
my tutorial. I''m using Ruby on Rails 3 Tutorial - Learn Rails by
Example by Michael Hartl.
After rebooting my server I ran an rspec spec/ command to check to see
if there were any problems and this is what I received. I didn''t modify
anything except I did overwrite users_controller.rb and
2005 May 27
0
tag, content_tag: are nil-valued options ever useful?
In a number of places in my code I pass options whose value are '''' or
nil to one of the tag-generation helper methods. In the HTML this shows
up as, e.g.
<span class="">
Now, this can be pretty wasteful, but I don''t want to change my evil
ways. Thus I''d rather have the framework throw out these options than
do it myself. AFAICT, all tag