Displaying 20 results from an estimated 90000 matches similar to: "URL generation"
2009 Jan 12
0
url_for, routes, and the current url
I need to generate 2 types of URL and have defined my routes as:
map.country_yes
"/:country/
yes", :controller=>"posts", :action=>"country", :yes=>true
map.country_no
"/:country/
no", :controller=>"posts", :action=>"country", :yes=>false
map.yes "/yes", :controller=>"posts",
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''
2006 Jul 08
0
Different URL generation in regular and named routes.
Obviously I am missed something, but why the way a path is generating
using named routes is a little bit different from using regular url_for?
1. Parameters from current request did not affect named routes, the way
it is in the url_for.
2. only_path=>false by default in named routes. It is true by default
whe using *_path instead of *_url, by why not to set it true by default
in *_url and
2007 Nov 20
3
How to test views with Nested Resources and Partials
Hi everyone,
I am relatively new to rspec and I am running into a wall in testing my
views. I have a RESTful resource Contracts with a nested resource of
Line_items.
I am trying to figure out how to test the "edit" form of the Line_items.
What complicates this is the nested routing and how to account for it,
and that there is a partial form (_form.haml) that both the edit.haml
and
2007 Nov 15
1
''lazy'' url generation in view specs
Hi,
I would like to use the ''lazy'' style of url generation in my views,
omitting parameters from my calls to url_for (and named route
methods) that are then filled in from the current request parameters.
Example:
url_for(:action => ''index'') will fill in (:controller => ''posts'') if
params[:controller] is ''posts''
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
How to change paypal url from sandbox to papal original url. i am using paypal lib -- paypal (2.0.0)
2009 Mar 19
0
How to change paypal url from sandbox to papal original url. i am using paypal lib -- paypal (2.0.0)
sub :How to change paypal url from sandbox to papal original url. i am using
paypal lib -- paypal (2.0.0)
Hi all,
I am test my application with local it working fine when i want to go for
live. i need to change the pay pal form target to Paypal orginal site
address.
I don''t know how to chage the form target in paypal helper. i paste my code
below.. plz check it.
I use paypal lib
2007 Sep 18
0
Help with RESTful named url options
I''ve found quite a few posts on the subject, but no satisfactory
answers. Maybe Rails just doesn''t support this yet.
How do I create a url with a named RESTful route that also has
parameters?
I want to write this:
link_to_remote "Show Details", {:url => item_url(@item, :details =>
1), :method => :get}
And get this:
<a href="#"
2006 Aug 08
1
Named routes and url generation?
Hi all
In my application I''ve some named routes defined this way...
map.label_context1 '':context1/label'', :controller => ''mycontroller''
map.label_context2 '':context1/:context2/label'', :controller => ''mycontroller''
map.label_context3 '':context1/:context2/:context3/label'', :controller
=>
2007 Apr 22
7
Getting a complete URL from Rails
Hello,
I''m sending out an e-mail message to new users of my service. I want
to send a particular link in this e-mail but I can''t figure out how to
get a complete URL from the url_for method. Is there a way to do this
without manually setting the host name?
Thank you,
-- Miles
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are
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
2007 Sep 06
3
routes, default_url_options and languages
Hello,
My app is available in 2 languages, English (en) and French (fr).
*I would like all my URLs to look like this :*
/fr/companies
/en/companies
*I''ve setup this route :*
map.connect '':lg/:controller/:action/:id''
I don''t want to specify the :lg parameter in every url_for calls.
The language remains the same unless the params[:change_lg] is set.
*In my
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 Mar 06
5
Setting :canvas => false for URL generation doesn''t always work?
I generate a lot of URL''s in my Facebook related code that point to our main
site, not our FB app. My understanding was that the way to do this was to
use ":canvas => false" as a parameter to url_for and link_to and so on.
However, that doesn''t seem to generate the proper URL''s. The URL''s still
point to apps.facebook.com (because they
2007 Mar 19
2
Controller url_for modifies request object?
Hi,
In my controller, I do something like this:
MyMailer.deliver_signup_notification(url_for(:subdomain =>
account.subdomain, :controller => ''hello''))
And a few lines later:
redirect_to :action => ''index''
Much to my confusion, the redirect routes me to the subdomain used in
the url_for. I''ve tried
redirect_to :action =>
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/.
2008 Oct 20
0
CGI and NET::SSH in the same script problems
I''m perplexed as to why I can run the following just fine from a command
line, but when I try to execute from a web browser it crashes.
From the command line it prints out...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"><HTML><BODY><H3>FlyBOB Control
Panel</H3><P>cmd=>[echo
2008 May 16
0
Problem with :action => 'destroy' in url_for
url_for( :controller => ''foo'', :action => ''destroy'', :id => 1 ) => ''/
foo/1''
url_for( :controller => ''foo'', :action => ''destroy_x'', :id => 1 ) => ''/
foo/destroy_x/1
url_for( :controller => ''foo'', :action => ''destroy'', :foo_id => 1 )
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 Jul 19
2
Transform URLs from: "url.com/Bob+Doe" to "url.com/bob_doe"
Is that possible, and would you know how I can do that?
I''m creating individual pages for users based on their first and last
names.
In my routes.rb, I have:
map.client '':user_full_name'', :controller => ''user'', :action =>
''individual_user_page''
Then in my controller, I have:
def individual_user_page
@user =