Displaying 20 results from an estimated 10000 matches similar to: "automatic URI encoding on url_for?"
2006 Jul 31
0
problems testing helpers - link_to and url_for don''t work...
So I''ve used the helper test plugin, and also tried some things from
Rails Recipes, and basically neither seems to work for cases where a
helper does anything related to link_to/url_for, and this includes
calling named_routes. This is obviously an issue, as a common use for
helpers is to refactoring something like this:
<%= link_to "text that changes slightly", :id => id
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
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>
2005 Aug 08
1
url_for()/link_to() Broken under Webrick?
After successfully getting my "productized" sites into production, I decided it
was time to get the development environment working (i.e. through "script/server
--site=foo"). However, when I go to run a site under Webrick, I get two major
errors:
(0) Routes don''t seem to work properly, specifically the root-level route gets
ignored. Instead,
2005 Dec 18
0
Fromcontroller to the url_for() representation
Hi,
I''m trying to generate the url_for parameters ina controller to pass
down to a view. And I want to pass in the link_to() params. One of the
things I need to pass is the :controller part.
So I''m in the controller itself, and I want to change the self.class
(or it''s to_s represantation) to the format needed by link_to().
For example:
class MyController <
2006 Nov 28
1
link_to and url_for in ActionMailer
I am new to ActionMailer and having a problem.
I want to be able to send a notification e-mail when a new item is added
to a list. Sending an e-mail to the right people on creation is working
fine.
However, I want to include in the e-mail a link to the application so
that users can click on the link in the e-mail and immediately be taken
to the show view for the new item. When I add a link_to
2006 Mar 31
1
url_for leave out ''index'' action
I''m trying to reduce the size of urls in my app and i was wondering how i
can get all links to an index action to leave out the ''index''. In my
routes.rb, i have it setup to recognize the controller and default to the
index action.
But is there a way to make it so that the ''index'' portion in the url is not
shown to the user? This is mostly a concern
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
2006 Mar 12
2
Strange error: undefined method `rewrite''
Hi,
when I generate a new rails project with a simple scaffolded controller,
I get a strange error message, whenever it tries to call the url_for
method, for example:
,----
| undefined method `rewrite'' for #<Url:0xb7675e64>
|
| Extracted source (around line #7):
|
| 4: </p>
| 5: <% end %>
| 6:
| 7: <%= link_to ''Edit'', :action =>
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
2007 Apr 07
1
Undefined Method 'rewrite' when calling link_to
Whenever I try to pass an options hash to the link_to method (or
url_for, or button_to) I get this error:
undefined method `rewrite'' for
[]:ActionController::Routing::PathSegment::Result
The trace ends with
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/base.rb:522:in
`url_for''
2008 Apr 07
0
link_to only links to current controller?
This is really confusing to me- I have some code in a page on the site
I''m working on that works absolutely fine on one version of the code and
totally doesn''t work on a newer version, in spite of the fact I can see
no difference whatsoever either in the rhtml pages, the controller or
any of the routing code. Right now I literally have no idea what the
cause of this could be.
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 Sep 20
1
undefined method `request' for "products":String ?
Since updated edge yesturday i have had a series of errors related to
undefinded methods for "products":String.
I do have these controllers namespaced.
====
Errors example 1:
undefined method `request'' for "products":String
Extracted source (around line #2):
view:
<tbody>
<%= render :partial => ''admin/products/product'',
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
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,
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 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!
-
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''t work anymore.
the other oddity is that when i
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