Displaying 20 results from an estimated 100000 matches similar to: "link_to, url_for and render_component from a plugin"
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 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
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 Nov 19
3
link_to and GET parameters
Hi,
I am trying to generate a link to external site with GET parameters
( in new window).
I tried following code, but it does not produce any parameters.
<%=link_to "Open New Page", "https://www.foo.com/page/", {:popup =>
true}, {:param1 => "value1", :param2 => "value2"}%>
and
<%=link_to "Open New Page",
2007 Apr 09
8
How do I use link_to with all the current options?
In one of my pages I want to create some URLs that go to the same
page, but tack on an extra parameter (column sorting stuff). How do I
do that?
I''ve tried
link_to "Title", :sort => "title"
and that''s pretty close...it keeps the controller name, but it doesn''t
include one of the parameters. I''m using nested routes, so the URL
should
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 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 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''
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 .
2006 Sep 15
2
Link_to with anchor?
Hi!
Very silly question, but how do you use link_to with an anchor, for
example:
www.website.com/articles/123#comments ?
Just can''t figure out!
Thank you!
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this
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.
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,
2008 Oct 12
0
How to test with RSpec a Rails plugin using “link_to” and “current_page?”
I''m writing a Rails plugin that builds up a menu in a view. I''m using
*link`_`to* to build the link and *current_page?* to set
class="active" on the current page.
I''ve *include*d *ActionView::Helpers::UrlHelper* so I can use
*link`_`to*.
To get *current`_`page?* working in the view, I''ve had to inherit the
current class (apparently ActionView::Base)
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 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
2009 Jan 18
3
ActionMailer and url_for in helper methods
Hi,
I was wondering how to get url_for to work inside ActionMailer. I did
research on the web but I can''t seem to find something that fits what I
need.
In my application, each user can specify their custom domain to access
their. I have an ActionMailer that sends them notifications of changes
that occur. In there, I have a breadcrumbs helper method, which
generages something like:
2006 Sep 12
2
Cache sweeping and render_component (my mistake or Rails bug?)
Hi
I''m working on a program which relies on heavy cache sweeper usage.
I''ve just bumped onto an odd problem. When using render_component
method in layouts or templates with cache sweeping turned on, Rails
throws an exception with the following message:
NoMethodError in TestController#index
You have a nil object when you didn''t expect it!
The error occured while
2007 Mar 28
5
link_to best practice
I''m looking for best practice for creating a hyperlink which has both an
icon and text.
I am currently using this in my view:
<%= link_to image_tag(''icons/add.png'', { :align => ''absmiddle'', :border
=> 0, :size => ''16x16'', :alt => ''New education record'', :title => ''New
education
2008 Dec 17
2
Help with link_to and its kin
Hi Everyone
I am a new user of Ruby and Rails, and would like some help with the
following problem.
I have created a navbar with a styled unordered list and I would like
to apply class="current" to the tab for the current page.
Currently I am using a large, cumbersome and ugly if..then block,
rendering the class="current" into the html and link_tos with
current_page?.
I am
2008 Sep 17
0
Problem with url_for and namespaces (in in_place_editing)
Hello,
Well I have been working with the in_place_editing plugin and have
been running into the following error:
Unknown action
No action responded to 1
My code on my view is below:
<span id = "permission"><%= @permission.name %></span>
<%= in_place_editor "permission", {:url => url_for(:action =>
"update", :id => @permission.id) }