Commit Graph

35 Commits

Author SHA1 Message Date
Vijay Dev
7c90d91c3c Clean up module docs [ci skip]
Removed some useless docstrings and no-doc'ed some.
2012-03-07 01:04:14 +05:30
Piotr Sarnacki
0e94208a0f Can't cache url_options on a controller level
It fails if routes from to railties are called in one context,
for example: blog.posts_path and main_app.users_path
2012-03-02 18:47:15 +01:00
José Valim
d7014bc7ea Optimize path helpers. 2012-03-02 01:59:03 +01:00
Xavier Noria
bb4dedbc2c deletes spurious arrow 2011-08-27 15:34:33 -07:00
Xavier Noria
e5524d538c minor edits after going through what's new in docrails 2011-05-14 11:15:43 +02:00
Nick Sutterer
e1ceae576e added an example for AC::UrlFor usage to make usage simpler. 2011-05-12 09:58:26 +02:00
Nick Sutterer
e3b3f416b5 added docs for AbC::UrlFor and AC::UrlFor. 2011-05-12 09:31:36 +02:00
Josh Kalderimis
2fe43b694f :subdomain, :domain and :tld_length options can now be used in url_for, allowing for easy manipulation of the host during link generation.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-23 09:54:42 +01:00
José Valim
8aa3684e07 Do not cache the script name outcome. 2010-09-27 21:14:18 +02:00
thedarkone
8fdb34b237 Cache url_options on a per-request basis. 2010-09-27 17:45:59 +02:00
Piotr Sarnacki
79bd92b783 Refactor ActionMailer to not use hide_actions 2010-09-03 22:59:11 +02:00
Piotr Sarnacki
befa77fc18 Fix generating urls with mounted helpers in view context
There were actually 2 problems with this one:
* script_name was added to options as a string and then it was used
  in RouteSet#url_for with usage of <<, which was changing the original
  script_name
* the second issue was with _with_routes method. It was called in RoutesProxy
  to modify _routes in view_context, but url_helpers in views is just delegating
  it to controller, so another _with_routes call is needed there
2010-09-03 22:59:10 +02:00
Piotr Sarnacki
233be6572c Ensure that env is always available in controllers 2010-09-03 22:59:06 +02:00
Piotr Sarnacki
b697ba9fd7 Added some more tests for url generation between Engine and Application 2010-09-03 22:59:06 +02:00
Piotr Sarnacki
8a077089d9 Get rid of :skip_prefix options in routes 2010-09-03 22:59:06 +02:00
Piotr Sarnacki
eedbf87d15 New way of generating urls for Application from Engine.
It's based specifying application's script_name with:
Rails.application.default_url_options = {:script_name => "/foo"}

default_url_options method is delegated to routes. If router
used to generate url differs from the router passed via env
it always overwrites :script_name with this value.
2010-09-03 22:59:05 +02:00
Wincent Colaiuta
75b32a69a1 Fixes for "router" and "routes" terminology
Commit f7ba614c2db improved the internal consistency of the different
means of accessing routes, but it introduced some problems at the level
of code comments and user-visible strings.

This commit applies fixes on three levels:

Firstly, we remove or replace grammatically invalid constructs such as
"a routes" or "a particular routes".

Secondly, we make sure that we always use "the router DSL" or "the
router syntax", because this has always been the official terminology.

Finally, we make sure that we only use "routes" when referring to the
application-specific set of routes that are defined in the
"config/routes.rb" file, we use "router" when referring on a more
abstract level to "the code in Rails used to handle routing", and we use
"routing" when we need an adjective to apply to nouns such as
"url_helpers. Again this is consistent with historical practice and
other places in the documentation.

Note that this is not a sweep over the entire codebase to ensure
consistent usage of language; it is just a revision of the changes
introduced in commit f7ba614c2db.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-03 22:42:31 +02:00
Piotr Sarnacki
f7ba614c2d Unify routes naming by renaming router to routes
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-02 01:51:03 +02:00
wycats
eebac02606 Make named helpers unprotected without becoming actions [#4696 state:resolved] 2010-06-07 15:29:55 -04:00
wycats
9444ac9312 Refactor the RouteSet so it uses a Generator object instead of one huge method. 2010-03-09 10:20:56 -08:00
Carl Lerche
9a17416d8b Tweak out url_for uses :script_name and add some tests 2010-03-04 22:00:30 -08:00
Carlhuda
900a2d304a Get rid of relative_url_path in favor of respecting SCRIPT_NAME. Also added a way to specify a default SCRIPT_NAME when generating URLs out of the context of a request. 2010-03-04 17:43:46 -08:00
Carlhuda
bcfb77782b Work on deprecating ActionController::Base.relative_url_root 2010-03-03 15:49:52 -08:00
Carlhuda
bae691f61a Change the API for setting global options for #url_for to self.url_options = { ... }
This attr_accessor can be set in a before filter or in the action itself.
    Overwriting default_url_options still works but will output a deprecation notice.
2010-02-26 15:20:41 -08:00
Carlhuda
98f77e0827 Rename named_url_helpers to url_helpers and url_helpers to url_for 2010-02-26 15:04:50 -08:00
Carlhuda
36fd9efb5e Continued effort to deglobalize the router 2010-02-25 17:53:01 -08:00
Carlhuda
226dfc2681 WIP: Remove the global router 2010-02-25 17:53:00 -08:00
Martin Schürrer
6bc24d40d5 Use ActionDispatch::Routing everywhere 2010-02-21 13:43:51 -08:00
Jeremy Kemper
fd567785f4 Make UrlWriter includable in a Module 2010-02-05 12:23:22 -08:00
Jeremy Kemper
e5ab4b0d07 Convert to class_attribute 2010-02-01 02:02:42 -08:00
José Valim
3f84091937 ActionMailer should depend just on AbstractController. 2010-01-29 17:51:05 +01:00
José Valim
f564f947d9 Remove duplicated url_for code and move methods shared between ActionMailer and ActionController up to AbstractController. 2010-01-07 15:31:50 +01:00
Joshua Peek
29c8a43056 Rename RackConvenience => RackDelegation 2009-12-20 20:05:26 -06:00
Yehuda Katz
4bf516e072 More perf work:
* Move #set_cookie and #delete_cookie inline to optimize. These optimizations should
    almost certainly be sent back upstream to Rack. The optimization involves using
    an ivar for cookies instead of indexing into the headers each time.
  * Was able to use a bare Hash for headers now that cookies have their own joining
    semantics (some code assumed that the raw cookies were an Array).
  * Cache blankness of body on body=
  * Improve expand_cache_key for Arrays of a single element (common in our case)
  * Use a simple layout condition check unless conditions are used
  * Cache visible actions
  * Lazily load the UrlRewriter
  * Make etag an ivar that is set on prepare!
2009-08-11 15:03:53 -07:00
Yehuda Katz
bd6b61be88 Rename /base to /metal and make base.rb and metal.rb top-level to reflect their module locations 2009-08-06 19:52:11 -03:00