search for: url_for

Displaying 20 results from an estimated 384 matches for "url_for".

2006 Jan 12
3
url_for in tests
Hi there, I''ve added an extra bunch of testing features for doing in-browser testing with Selenium, and am having quite a time figuring out how to use url_for with having a controller object present. I''ve tried using ActionController::Base.url_for and ActionView::Helpers::UrlHelper.url_for but haven''t been able to get something that works. What I want to be able to do is call url_for(:controller => ''test'', :acti...
2006 Sep 07
5
url_for always escape string.
according to the documentation, only the url_for from ActionView escape the URL. which happens on this line escape ? html_escape(url) : url and can be prevented by passing :escape => false to url_for. still according to the documentation, the url_for from ActionController is not supposed to escape the url. BUT IT DOES. at the moment of th...
2006 Sep 22
1
url_for params
Hi, url_for has a nice way of using the current ''params'' object to fill in default parameters in a route. For example, map.connect '':controller/:action/:id/'' with <%= url_for :action => ''my_action'' %> will redirect to the current controller. All...
2005 Mar 06
2
Using url_for in ActionMailer templates
...e basic e-mail notices to my Rails app using ActionMailer, and have one small issue. I want to provide a confirmation URL to users who sign up for an account. I can obviously just hardcode the URL and append the confirmation code to it, but I''d much rather be able to use something like: url_for(:controller => ''authentication'', :action => ''confirm'', :confirmation_code => confirmation_code) and spit that URL out. However, it seems taht within the context of the AM template, no controller is defined, so calling url_for() results in an error &quo...
2007 Mar 19
2
Controller url_for modifies request object?
Hi, In my controller, I do something like this: MyMailer.deliver_signup_notification(url_for(:subdomain => account.subdomain, :controller => ''hello'')) And a few lines later: redirect_to :action => ''index'' Much to my confusion, the redirect routes me to the subdomain used in the url_for. I''ve tried redirect_to :action => ''...
2006 Oct 22
2
url_for In a Component?
When I try to use url_for within a component I get the following: NoMethodError in LinkController#get_links undefined method `url_for'' for Navbar::LinkController:Class The API docs show url_for as a public method of ActionController::Base. Since my component is derived from ActionController::Base shouldn...
2007 Sep 07
3
how to pass an array through url_for.
hi , every one. i just want to generate url from url_for method like this: url_for(:controller=>"users",:action=>"index",:names=>["aotianlong","ayowaya"]) i except it''s generate users?names[]=aotianlong&names[]=ayowaya but it''s generated : users?names=aotianlong%2Fayowaya any i...
2006 Jan 19
9
start_form_tag not taking url_for options
I''ve got a form that should post to user/login. The code to start the tag is: <%= start_form_tag { :controller => "user", :action => "login" } %> That gives me this exception: compile error script/../config/../app/views/user/login.rhtml:1: parse error, unexpected tASSOC, expecting ''}'' _erbout = ''''; _erbout.concat((
2008 Sep 17
1
url_for not working in model
Hi, I am using ''url_for'' for constructing url in my model but it gives me error <NoMethodError: undefined method `url_for'' for Xyz:Class> how to access url_for in model and it possible to call controller method in model and how to call it? Please urgently give reply? -- Posted via http...
2007 Jan 02
2
link_to method throws a url_for error
...;'m using ActionMailer and am using a template in app/views/welcome_mailer/join.rhtml which has this line: <%= link_to :controller => ''group'', :action => ''join'', :group => @group.id, :ic => @code.code %> The error is: undefined method `url_for'' for #<WelcomeMailer: 0x2aaaad4fb470> I know the variables are OK because I''ve tested them. If I change the link_to to a url_for, I get the exact same error. Anyone know what''s the problem? All help is appreciated & thanks in advance! -Jason --~--~-----...
2007 Mar 03
5
url_for and arrays parameters (diffs between rails 1.1.6 and 1.2.2)
.../99845), but haven''t received any replies yet, so maybe this question is better suited here. Sorry if this has been brought up before, I couldn''t find any previous discussion on this. To summarize the post... When using the latest Rails (1.2.2) I''m passing an array to url_for like so... url_for :controller => ''test'', :action => ''list'', :fields => %w(a b c d) and that generates... "/test/list?fields=a%2Fb%2Fc%2Fd" params[:fields] in the action contains "a/b/c/d" When using Rails 1.1.6, the same url_for c...
2007 May 11
1
url_for and capitalization..
i am having a very weird problem with url_for.. i have been using this for several version of rails, but recently, i had a problem.. it seems as though url_for is causing the results to be returned in lower case.. if there are uppercase letters in the arguments, they result is all lower case. obviously, this is a problem as the urls don'...
2007 Nov 14
3
absolute urls in url_for vs. link_to
In both url_for and link_to, the :only_path param can be used to determine whether the link url used is complete with hostname and path, or just has the path (a kind of relative url). However, in url_for it defaults to false (urls with hostnames), and in link_to it defaults to true ( urls without hostnames, just...
2006 Jul 12
12
pass hash as parameter
Hello, How can I pass a hash as parameter from a template with url_for? e.g. : if I have test = { :a => "a", :b => "b" } How can I pass that with my request? Is it possible to pass nested hash''es to? Right now, url_for :action => :test, test doesn''t seem to work. Thank you, -- ------------------------------...
2006 Jun 19
0
url_for missing out parameters?
Having a bit of an issue with url_for The current page I''m on has a named route as follows: map.some_page ''page/:id/:range'', :action => ''the_action'' All looks fairly normal. I have an url_for on this page to make a link to another page as so: url_for(:controller=>''other...
2006 Feb 09
2
How to call a standard function from a class inside the lib folder ?
Hello, I try to use url_for from a class inside the lib folder class Test    def self.mytest options        url = url_for( options )    end end But I have this error : *undefined method `url_for'' for Test:Class* How can I use it ? Thanks _______________________________________________ Rails mailing list Ra...
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...
2008 Apr 05
0
url_for + :canvas => false weirdness for non resource controllers
I noticed something strange in my app today. It appears that the extra canvas path appended in url_for is back but only for controllers that are not resources. Here is an example I have in my site: campaigns is a resource checkout is not # With the canvas false flag (rdb:1) @controller.url_for(:controller => ''campaigns'', :action => ''show'', :id =>...
2007 Feb 21
6
Problem with url_for and https - overrides all options
I have a piece of code like this in one of my views: <%=link_to "link here", :action=>''my_action'', :id=>1 %> It works fine on my local development machine, running Webrick over http and it works fine on my testing server which is running single mongrel instance behind Apache 1.3 as a proxy. On both the outcome link is this: <a
2006 May 04
3
Problem using url_for
I''m trying to generate a URL of the form controller/action?id=<id>&type=<type>. My code looks like this: url_for(:controller => ''content'', :action => ''get_resource'',:id => item[''Id''],:type => item[''type''] ) The url I end up with looks like this: http://localhost:3000/content/get_resource?type=<type> (the &lt...