similar to: Writing a breakable loop? If it gets a match it should stop.

Displaying 20 results from an estimated 60000 matches similar to: "Writing a breakable loop? If it gets a match it should stop."

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 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 .
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 =>
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>
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''
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
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! -
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 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
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 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
2009 Jan 09
6
Accessing request.host in UserMailer
I am using subdomains in my application to control context. Therefor, during user registration, password reset, and other actions that require an email to be sent with a link to be clicked, I need to ensure that the subdomain appropriate for the user is used. It seems I need to be able to access request.host from within an ActionMailer model. But I am not clear how to do this. Any help would be
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
2013 Jan 12
4
nesting in CoxPH with survival package
Hello all, I am trying to understand how to specify nested factors when using coxph(), and if it is appropriate to nest these factors in my situation. In the simplest form, I am testing two different temperatures, with each temperature being performed twice in different experimental periods (e.g. Temp5 performed in Period A and C, Temp4 performed in Period B and D) I am trying to see if survival
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
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
2007 May 28
2
helper with block compile error
HI, i''m trying to write a helper that replaces link_to_remote that accepts a block but it gets a compile error in the template: I don''t know what I''m doing wrong... TIA # application_helper.rb def link_block_to_remote( options = {}, html_options = {}, &block) concat(link_to_remote(capture(&block), options, html_options), block.binding) end # in
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/.