Displaying 20 results from an estimated 400000 matches similar to: "If you want to use url_for in lib scripts..."
2006 Feb 16
1
runner: url_for with mailers impossible
I created a runner script to send a newsletter. I found this hack where
you pass a controller and specify a helper:
http://wiki.rubyonrails.org/rails/pages/HowtoUseUrlHelpersWithActionMailer
But in a runner script there is no controller to pass. So, it looks like
it''s impossible to use url_for in the mailer template this way.
Another way around the no url_for problem is to pass the
2006 Feb 05
0
is there an inverse of ''url_for''
What I want to do is take a url string (from a file,db,form field,...)
and turn it into a hash.
For example:
string = ''proto://host.com/posts/show/10?user=joe''
url_to_hash(string) #=> {:controller => ''posts'', :action => ''show'', :id
=> 10, :user => ''joe''}
Does rails have anything like this already built in,
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!
-
2008 Sep 17
1
url_for not working in model
Hi,
I am using ''url_for'' for constructing url in my model but it gives me
error
<NoMethodError: undefined method `url_for'' for Xyz:Class>
how to access url_for in model and it possible to call controller
method in
model and how to call it?
Please urgently give reply?
--
Posted via http://www.ruby-forum.com/.
2007 Jan 16
1
Can't pass parameters to Ziya controller using url_for
Hi All,
I''m stuck yet again. I have an action on a controller that produces a
Ziya graph, which I call using the gen_chart() helper. However, I can''t
seem to pass more than one parameter through to the action.
<%= gen_chart( "overview_graph",
url_for( :controller => ''graph'', :action => ''graph'', :graph_id =>
2006 Jun 24
1
DRY up link_to_remote and its url_for
In an attempt to provide a gracefully degradable link_to_remote, I
repeat myself every time:
<%= link_to_remote(''Signup'',
{:url => {:controller => ''user'', :action => ''signup''}},
{:href => url_for(:controller => ''user'', :action => ''signup'')}) %>
Looked around the RDoc &
2006 Sep 06
3
url_for , controller routing error
I have an ''account_controller.rb'' in an ''admin'' module
I list the accounts with : http://0.0.0.0:3000/admin/accounts/list,
and get my table
trying to sort it, I use the follwoing sort_link_helper :
def sort_link_helper(text, param)
key = param
key += "_reverse" if @params[:sort] == param
options = {
:url =>
2006 Apr 11
0
url_for - results inconsistency ??
Hi all,
I recently noticed something really weird in url_for results
let''s say that we have something like this somewhere in code
<pre>
URL1:<%=url_for( {:action=>''foobar''}.merge({''action''=>''ohmy''}) )%>
URL2:<%=url_for(
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 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
2006 May 04
4
What do you use RJS for?
I''ve read an intro or two for RJS, but I don''t fully get what it may be
used for - AJAX? Please post what you currently use RJS for.
Thanks!
Joe
--
Posted via http://www.ruby-forum.com/.
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:
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 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 Mar 03
5
url_for and arrays parameters (diffs between rails 1.1.6 and 1.2.2)
Hello,
I posted this to the main rails list
(http://www.ruby-forum.com/topic/99845), but haven''t received any
replies yet, so maybe this question is better suited here. Sorry if
this has been brought up before, I couldn''t find any previous
discussion on this.
To summarize the post...
When using the latest Rails (1.2.2)
I''m passing an array to url_for like so...
2006 Jun 09
0
disable escaping of ActionController::Base.url_for
Hi!
I am trying to use rails for a wml/wap application. Submitting forms
with wml goes something like that:
<input type="text" name="search" value="" />
<a href="/portal?search=$(search)">goto</a>
The wap browser replaces $(search) in the url with the text entered in
the input field. Now to my problem.
To use the routing information
2006 Mar 06
13
Internal Server Error - I want to cry
I got a brand new Fedora Core 4 box and was all excited to get Rails
running on it. That was about two days ago. I did all the ''yum install
ruby, etc. etc. etc.'', then ''gem install rails, etc. etc. etc''. I''ve
tried running Rails with httpd (fastcgi and cgi), lighttpd (scgi,
fastcgi, cgi), mongrel, webrick, and even ''ruby
2006 Apr 14
10
DHH Says...F You
WTF was this about?
http://www.flickr.com/photos/planetargon/127984254/
Joe
--
Posted via http://www.ruby-forum.com/.
2006 Apr 07
0
Getting Mongrel to execute scripts?
I just want to create some quick and dirty scripts (PHP, Ruby, Perl) in
my /public directory. Mongrel handles them like text files. Is there a
way to get Mongrel to execute them?
Joe
--
Posted via http://www.ruby-forum.com/.
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