similar to: url detection

Displaying 20 results from an estimated 100000 matches similar to: "url detection"

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 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 Feb 16
4
Auto detect URL for ActionMailer?
Hi, how can I call the url in an actionMailer definition - so that it automatically detects what the rails application server is and puts it in the url that is mailed to the client? (I don''t want to have to change it every time the hostname is changed - I''d like the application to auto detect what the host is - whether it''s localhost:3000 or my own website... example:
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 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
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 05
1
Named routes and current_page? incompatibility
Hi, I have some named routes defined e.g. map.public and wish to use link_to_unless_current() to disable link. However, as I''ve seen from forum discussions and the API doc, the issue lies with the fact that the named_route_url() method generated by a named route does not default to only_path = true like url_for. Therefore, the current_page? within link_to_unless_current() will not
2009 Jun 25
1
request.host, proxy chains and HTTP_X_FORWARDED_HOST
Hi, We''ve an application that uses url_for in controllers and views. In views, url_for generates a relative url (as if :only_path where used). All is fine there. However, in controllers, url_for generates a full url, with the host name. This causes problems when we have a chain of Apache proxy servers: My Browser ---> Proxy 1 ----> Proxy 2 ----> Phusion Deployment Server. In
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''
2008 Apr 30
3
pretty url
I want to write a permalink like /year/month/day/title, code is as follows: self.permalink = "#{now.year}/#{now.month}/#{now.day}/#{title}" in the view, I use restful url post_path(@post). And in the html source code, the url is /posts/2008%2F4%2F30%2FTest You can see, the ''/'' is replaced by "%2F", which is not I expect. How not to replace the
2006 Jul 11
9
problems with observe_field
Hi all, I''m having problems with an observe_field, this is the view: <%= form_tag %> <div id="content"> <p>Customer: <select name="cliente_id" id="cliente_id"> <option value="">Select a customer</option> <%= options_for_select Cliente.find_all.collect {|c| [c.razon_social, c.id]} %>
2007 Jan 09
10
Writing a breakable loop? If it gets a match it should stop.
I''m trying to write a function that will accept a rails URL, and see if it matches one of my Rights. Rights are just controller URLs, so I can manage access at the controller level (don''t need action level). What I''m trying to do is take the url passed, and see if its access controlled. If it is, the method should stop and return true, if not it will return false. This
2008 May 11
3
Get current controller name/action name from view
Hi. I swear I found this in the group archives, but now I cannot find this in the group or elsewhere online! In a view I would like to get the current controller name and action that was used to get here. For example, I have a template that I''m using from two different controllers (and four different actions in each controller), such as :controller => "my_view", :action
2008 Jan 25
8
simple routing & linking question
So I have an existing app & facebook app in same rails application, for now I have decided to go the route of creating a controller for facebook stuff (called FaceController). (setup is canvas, fbml) So I have: facebook config http://myurl:myport/face/ My controllers name is face, so I dont even need a manual route, for the landing page it works like a charm. but, when I try to make
2006 Jun 04
3
Absolutize URLs in a string
I wonder - do we have some helper/processor/gem to automatically convert all URLs in a passed string to their canonical equivalent - i.e. with the protocol, host and such prepended based on the Rails environment. Super-duper infty for RSS feeds (I hate their requirement for canonical URLs everywhere). -- Julian ''Julik'' Tarkhanov please send all personal mail to me at
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 .
2008 Nov 18
2
rss feed is not detected in firefox ?
my rails version is 2.2.0 i have created a rss feed It is working fine in IE but in fire fox only xml content is showned like "This XML file does not appear to have any style information associated with it. The document tree is shown below." any idea ? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because
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 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 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 =>