similar to: Modifying URLs

Displaying 20 results from an estimated 100000 matches similar to: "Modifying URLs"

2006 Jun 21
0
url_for generating URLs without relative root
I''ve got an app that has ActionController::AbstractRequest.relative_url_root = "/super" set in environment.rb. I''d like to use url_for to generate URLs without the relative root, or even be able to specify a different relative root. Is that possible somehow? Pat
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 Jul 12
3
How to get the current URL?
Hi, how can I get the current URL withing a controller? There seems to be no appropriate method in ActionController::Base. I''m creating a site, which requires a login for some pages. I''m using before_filter for authentication. My idea was to store the currect URL in a session before redirecting to the login page and then redirect to this URL after successful authenfication.
2009 May 15
0
[PATCH server] final cleanup for service layer refactoring.
I've pulled out the no-longer-necessary remnants of the old way of handling auth and before_filters as well as fixing a couple bugs that had crept in along the way. Unit test fixes for the refactoring will follow in a subsequent patch. Signed-off-by: Scott Seago <sseago at redhat.com> --- src/app/controllers/application.rb | 46 ----------------
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! -
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 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 Jan 09
1
testing UrlHelper in ActionMailer
Hi All, So I found a helpful web page that explained how I could use things like url_for in my mails: http://wiki.rubyonrails.com/rails/pages/HowtoUseUrlHelpersWithActionMailer However, I can''t test them properly. The problem is that when I create a controller in my unit tests and pass it into the ActionMailer, it''s not a real controller, set up as a controller is when it is
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
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
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
2005 Jun 06
1
Rails spider/site copy with internal web requests
Hi all, On a related topic to Web spidering, I would like to solve a problem of internally spidering and saving a Rails application from within rails. The goal is to spider and save each resource in a site to a filesystem friendly structure /many/things/1?page=3 -> many_things_1_page_3.html or /many/things/1?page=3 -> many/things/1_page_3.html If a redirect is created
2006 Aug 31
2
Url rewriting for random urls
Hello, I have discovered the good use of stylesheet_link_tag and javascript_include_tag (I''m still learning) and it is very useful because I have to use the relative_url_root way. Now I wonder how I can use that for other URLs. I want a background image for a table cell so I have to write something like: <td align=''right'' valign=''bottom''
2007 Jan 25
0
Fragment Cache in ActionMailer
I have a controller which iterates through a group of people and dynamically generates an email for each person, it is a bit DB heavy so caching would really help. Adding ''include ActionController::Caching::Fragments'' to my BookingMailer model produces this error: ActionView::TemplateError (undefined local variable or method `perform_caching'' for
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
2006 May 13
3
Non-customizable parts in the routes hierarchy-chain.
Hi I created a custom route that looks like this: map.connect '':controller/:table/:action/:id'' Hierarchically, :table is above :action and :id. So, if we call ActionController::Base#url_for with an argument :table=>nil, we''re supposed to get a url with :action and :id set to nil as well. However, this is not the case: url_for(:table=>nil) from
2009 Jun 11
4
Using view helpers and route helpers in a model
Hi there, I am trying to get something working and its driving me crazy. I have been looking around for solutions to getting view helpers working in models and for the most part I find this solution. Add the following in the model you want to use them in include ActionView::Helpers::UrlHelper include ActionController::UrlWriter However, when I try something like
2009 May 13
1
[PATCH server] Cloud UI V1 (readonly).
This patch creates the shell for much of what the cloud ui will become. It is focused on layout (lightly fedora themed), accessibility, and 'bookmarkability'. This layout uses no javascript (that will be used to enhance interactivity in a future patch). It also introduces the idea of using a simple table rather than the more conplex js/json we use in the admin side. Plan here is to
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
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'', :action=>''display'', :id=>5,