similar to: Different URL generation in regular and named routes.

Displaying 20 results from an estimated 10000 matches similar to: "Different URL generation in regular and named routes."

2006 Sep 05
1
Named routes and current_page? incompatibility
Hi, I have some named routes defined e.g. map.public and wish to use link_to_unless_current() to disable link. However, as I''ve seen from forum discussions and the API doc, the issue lies with the fact that the named_route_url() method generated by a named route does not default to only_path = true like url_for. Therefore, the current_page? within link_to_unless_current() will not
2009 Mar 19
0
How to change paypal url from sandbox to papal original url. i am using paypal lib -- paypal (2.0.0)
sub :How to change paypal url from sandbox to papal original url. i am using paypal lib -- paypal (2.0.0) Hi all, I am test my application with local it working fine when i want to go for live. i need to change the pay pal form target to Paypal orginal site address. I don''t know how to chage the form target in paypal helper. i paste my code below.. plz check it. I use paypal lib
2008 Mar 06
5
Setting :canvas => false for URL generation doesn''t always work?
I generate a lot of URL''s in my Facebook related code that point to our main site, not our FB app. My understanding was that the way to do this was to use ":canvas => false" as a parameter to url_for and link_to and so on. However, that doesn''t seem to generate the proper URL''s. The URL''s still point to apps.facebook.com (because they
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
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
2006 Aug 08
1
Named routes and url generation?
Hi all In my application I''ve some named routes defined this way... map.label_context1 '':context1/label'', :controller => ''mycontroller'' map.label_context2 '':context1/:context2/label'', :controller => ''mycontroller'' map.label_context3 '':context1/:context2/:context3/label'', :controller =>
2009 Jan 12
0
url_for, routes, and the current url
I need to generate 2 types of URL and have defined my routes as: map.country_yes "/:country/ yes", :controller=>"posts", :action=>"country", :yes=>true map.country_no "/:country/ no", :controller=>"posts", :action=>"country", :yes=>false map.yes "/yes", :controller=>"posts",
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 May 27
0
Typo 1055 created_at Vs. published_at
[Couldn''t post this to the Typo forum, hope it''s Ok here :-)] Before I go off and create a Typo ticket, I''d like to know if anyone else is experiencing this and what there thoughts might be on the subject? In Typo 1055, if you use the admin interface and change the published date for an article, you will get "post not found", when you click on the article
2009 Jun 25
1
request.host, proxy chains and HTTP_X_FORWARDED_HOST
Hi, We''ve an application that uses url_for in controllers and views. In views, url_for generates a relative url (as if :only_path where used). All is fine there. However, in controllers, url_for generates a full url, with the host name. This causes problems when we have a chain of Apache proxy servers: My Browser ---> Proxy 1 ----> Proxy 2 ----> Phusion Deployment Server. In
2007 Aug 30
1
alias_method_chain stack level too deep in Rake test only
I have an odd error. I have the following module: module ActionController module SslSupport def self.included(base) raise "#{base} does not define url_for" unless base.method_defined?(:url_for) unless base.respond_to?(:url_for_without_ssl_supprt) base.send :include, InstanceMethods base.send :alias_method_chain, :url_for, :ssl_support end
2008 Jan 25
8
simple routing & linking question
So I have an existing app & facebook app in same rails application, for now I have decided to go the route of creating a controller for facebook stuff (called FaceController). (setup is canvas, fbml) So I have: facebook config http://myurl:myport/face/ My controllers name is face, so I dont even need a manual route, for the landing page it works like a charm. but, when I try to make
2006 Mar 04
0
Reading from Session in routes.rb?
Hi all, I''m developing some custom routes for an application and am creating the aliased url_for commands that I like so much. However, one of the things I''d like to do is read a string from the session (or possibly even pull out an object to get to the string) and use that in the URL generating by the route -- without having to pass the string into the url_for alias every time.
2007 Sep 18
0
[PATCH] Automatically set :only_path option to false when :host option is specified in url helpers
Hello, I''ve just posted a patch to the Trac. It intends to simplify the use of url helpers such as link_to when you use the :host option. When you''re using a helper such as link_to and that you provide a :host option to it, it''s not use by default, you have to set :only_path to false too to enable it (to have the full URL, not the relative one). This tiny patch
2006 May 08
0
testing named routes
Hello, I''m trying to test routes named within a map.with_options statement. I have in routes.rb: map.with_options :controller => ''films'' do |f| f.overviews ''films/:index'', :action => ''index'', :requirements => { :index => /index(artist|date|title)\.html/ }, :index => ''new'' etc... end and
2007 Mar 14
11
path vs. url
When using named RESTful routes, when should one use the generated ..._path helpers, and when the ..._url helpers? Say I did this in routes.rb: map.resources :users Where should I use users_path, new_user_path, etc., and where should I use users_url, new_user_url...? Thanks! Steve --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to
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
2005 Dec 22
2
routes and url_for
Hi, All. I try to relocate controllers. Admin space controlers moved to /app/controllers/admin and user space controllers to /app/controllers/user In routes.rb I use map.connect ''search'', :controller => ''user/search'' that correct I see. But when I want to use start_form_tag or simply url_for, that used in start_form_tag, I do not know how generate url
2009 Jun 17
1
url_for and rake routes differences
I am caching and expiring pages/actions/fragments in my code and I''ve come across a really frustrating problem In my routes I have prefixed all controllers with the :locale. This works well for the most part. When I cache a page/fragment it is cached to /en/whatever etc... as expected However when I try to expire the page/fragment the locale is not prefixed to the url but added as an
2006 Jul 16
0
Routes Misunderstanding
Hi there, I seem to be misunderstanding routes a little bit as I can''t get the behavior I''m expecting from the following. My goal is to get "/forums/1" from the code <%= url_for :id => forum.id %> which is being called from a view associated with a controller named "Forums" and the "index" action. I have the following routes: