similar to: Anyway for a model to call url_for?

Displaying 20 results from an estimated 8000 matches similar to: "Anyway for a model to call url_for?"

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 this line escape ? html_escape(url) : url url has
2006 Jul 28
11
Forum
Im making forum and i have problem with paths. Here is code: http://pastie.caboo.se/6389 With this code, it works. But its a bit weird to use so many paths function. For every path i need to make new function. So can you suggest me something. Tables are like here: http://wiki.rubyonrails.com/rails/pages/ForumExample -- Posted via http://www.ruby-forum.com/.
2007 May 06
3
Using session-type data in an ActiveRecord callback...
Any suggestions on how best to gain access to session-type information while in an ActiveRecord callback, such as after_save? I am encrypting some information in the database, using the generalized encryption/decryption handler in "Agile Web Development With Rails" (p 375ff). I got it working, and now I want to reference a session field (a user PIN) which is NOT stored in the
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
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 =>
2007 Apr 22
7
Getting a complete URL from Rails
Hello, I''m sending out an e-mail message to new users of my service. I want to send a particular link in this e-mail but I can''t figure out how to get a complete URL from the url_for method. Is there a way to do this without manually setting the host name? Thank you, -- Miles --~--~---------~--~----~------------~-------~--~----~ You received this message because you are
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 idiea ? thank you .
2005 Mar 06
2
Using url_for in ActionMailer templates
Hi All I am just adding some 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
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 very good. However, I sometimes want a url_for() which includes current parameters
2007 Jan 02
2
link_to method throws a url_for error
This error seems pretty bizarre. I''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>
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''t url_for be available within the class? Any ideas? Thanks! -
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://www.ruby-forum.com/.
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 paths). Is there any reason for this discrepency? To me, it violates the principle
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((
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:
2008 Sep 23
3
calling save in after_create hook
Scenario: I''m creating an image file upload service for my web site. As well as saving the actual file I also need to create a database record for the file. I would like to name the file after the record id, but I also need to save some attributes of the image (width/height/mime_type etc) which I can''t discover until after the file is created. The Problem: 1) The id is not
2007 Dec 21
3
Access url_for from rake task
How do I access ActionController:Base url_for method from a Rake task. I tried to access ActionController from irb but it doesn''t work? Check out the pasite http://pastie.caboo.se/131266 -- Anil http://anilwadghule.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To
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
2007 Mar 03
5
url_for and arrays parameters (diffs between rails 1.1.6 and 1.2.2)
Hello, I posted this to the main rails list (http://www.ruby-forum.com/topic/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...
2006 Apr 15
8
I need to send an email when something happens in my model...
but the model isn''t the right place to send mail from. That just seems like pretty bad coupling, generating emails from within the model. Or is that not a problem? On top of that, these emails need to contain links back to my site...which is a bit of a pain in ActionMailer, but I found directions on http://wiki.rubyonrails.com/rails/pages/HowtoUseUrlHelpersWithActionMailer however I