search for: parameters_for_method_reference

Displaying 20 results from an estimated 22 matches for "parameters_for_method_reference".

2006 Mar 27
13
Is this a bug in Ajax handling?
When a controller responds to a link_to_remote with a redirect_to, the link_to_remote gets a success callback, this would seem like a bug to me, at a minimum it should return a failure? This is driving me crazy because all the login engines/generators respond to an authentication error with a redirect_to. The work around is to change them to all do a render :layout => false, :status => 500
2006 Mar 13
1
issue with redirect_to
...ect_to to unlock the current iframe using {:TARGET => "_top"}. It always stays in the current frame. I checked the redirect_to code, it seems the method does not use "target". here is the source code of redirect_to from ActionController::Base def redirect_to(options = {}, *parameters_for_method_reference) #:doc: 753: case options 754: when %r{^\w+://.*} 755: raise DoubleRenderError if performed? 756: logger.info("Redirected to #{options}") unless logger.nil? 757: response.redirect(options) 758: response.redirected_to = opti...
2006 May 10
2
session[:return_to] for going back.
Hi, Is session[:return_to] something Rails maintains to quickly go back to the previous uri without having to keep track of the action name? Or, do we have to actually set it in our actions? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060510/7e36a528/attachment.html
2010 Aug 09
0
Expanding tests with own methods
...39;url_for'' in my functional test. e.g. assert_select "a[href=?]", url_for(:action => :new), :text => ''Neue Seite'' The book I am reading suggests doing this: class PagesControllerTest < ActionController::TestCase def setup def self.url_for(options, *parameters_for_method_reference) options.merge! :only_path => true @controller.url_for(options, *parameters_for_method_reference) end end ... end Why is it necessary to define ''url_for'' within the definition of the ''setup'' method? Why is it necessary to define ''url_for...
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
2005 Nov 29
0
undefined method `link_to'
...ned method `link_to'' for module `UserHelper'' how can I get access to helper from another helper? this is my users_helper.rb: module UsersHelper alias ink_to_original link_to alias link_to link_to_permission def link_to_permission(name, options = {}, html_options = nil, *parameters_for_method_reference) if @permission if html_options html_options = html_options.stringify_keys convert_options_to_javascript!(html_options) tag_options = tag_options(html_options) else tag_options = nil end url = html_escape(options.is_a?(String) ?...
2006 Jun 06
1
Redirect\Cookie bug with MSIE 5.5sp2
Hello all, There seems to be a bug in internet explorer 5 where a redirect causes the session to be lost. A controller says.... def login case @request.method when :post if @session[:user] = User.authenticate(@params [:user_login], @params[:user_password]) return redirect_to(:action=>''send_confirmation'') unless
2006 Jan 11
5
stack level too deep problem
...un the application, the second time I refresh the page I always get "stack level too deep error" module UsersHelper include ActionView::Helpers::UrlHelper alias_method :link_to_original, :link_to def permission? true end def link_to(name, options = {}, html_options = nil,*parameters_for_method_reference) if permission? link_to_original( name, options,html_options,*parameters_for_method_reference ) end end end the error message howing app/views/users/_table.rhtml where line #40 raised: stack level too deep Extracted source (around line #40): 37: 38: <th id="movTabl...
2006 Jun 26
0
Action caching with params
...parameters where passed in, which would result in incorrect data being rendered on a cached page. I eventually tracked the culprit to ActionController::Base#url_for, which the fragment cacher calls well reading and writing the fragment. In my controller, I added this: def url_for(options = nil, *parameters_for_method_reference) super( options ? options : params, parameters_for_method_reference) end which sends the params hash as options, if no options are specified (as is the case with the cacher). So is this a bug in rails or a misunderstanding on my part as to the proper behavior? Am I doing something dangerous h...
2006 Mar 12
2
Strange error: undefined method `rewrite''
...9;' | /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/url_helper.rb:49:in `link_to'' | #{RAILS_ROOT}/app/views/urls/show.rhtml:7 `---- I looked at the source and found out that the error originates from the following code: ,---- | def url_for(options = {}, *parameters_for_method_reference) #:doc: | case options | when String then options | when Symbol then send(options, *parameters_for_method_reference) | when Hash then @url.rewrite(rewrite_options(options)) | end | end `---- Where is this ''rewrite'' method supp...
2006 Jan 03
1
Passing parameters with link_to
...} render :action => ''list'' end end Now I want to make a link to the list_by_year action in show.rhtml <%= link_to @album.year, { :action => ''list_by_year'' }, {}, @album.year %> Isn''t this what the *parameters_for_method_reference is for? Obviously not because I get: wrong number of arguments (0 for 1) What is the correct way to pass this parameter? Haven''t found anything by googling. -- Posted via http://www.ruby-forum.com/.
2006 Aug 03
1
Why doesn''t redirect_to handle rjs?
Is there a good reason why redirect_to doesn''t check responds_to, so it can handle redirects in rjs calls? I''ve done something like this in my app controller, seems to work ok... alias_method :redirect_to_orig, :redirect_to; def redirect_to(options = {}, *parameters_for_method_reference) respond_to do |accepts| accepts.html do redirect_to_orig options, parameters_for_method_reference end accepts.js do render :update do |page| page.redirect_to options end end end end Am I doing something broken there,...
2006 Sep 04
2
how to? link_to with a rel="tag"
i want my html output to look like this: <a href="/path/to/page/" rel="tag">link text</a> how do i tell the link_to method that i need: rel="tag"? thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send
2008 Jan 28
3
A style question
I''m working on the ability to share a single session between Facebook and Non-Facebook requests. Right now, to setup a shared session, you create a link like: <%= link_to "Non-Facebook view",leaders_url(facebook_session_parameters.merge(:canvas=>false))%> The facebook_session_parameters includes all of the necessary info. Is this okay, or would it be better as
2006 Mar 06
4
Apache 2.x: Use fcgid or Mongrel?
Hi, There''s lots of stuff going on currently with choices of production deployment environments. But I''m not clear on a few things as I need to decide on a production setup where Apache is a given. A recent thread (http://www.ruby-forum.com/topic/56590) seemed to favor Apache 2 with mod_fcgid. And this is supported in articles such as:
2006 Sep 07
5
url_for always escape string.
according to the documentation, only the url_for from ActionView escape the URL. which happens on this line escape ? html_escape(url) : url and can be prevented by passing :escape => false to url_for. still according to the documentation, the url_for from ActionController is not supposed to escape the url. BUT IT DOES. at the moment of this line escape ? html_escape(url) : url url has
2006 Jan 10
4
Problem creating MockController
Hi there, I''m trying to create a mock controller to test the use of UrlHelper in ActionMailer. I''m trying this: require ''d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller'' # Re-raise errors caught by the controller. #class DiscussionsController; def rescue_action(e) raise e end; end class MockController < ActionController::Base def
2006 Mar 25
0
in_place_collection_editor
...=> 2, :name => ''Gossip''), Section.new(:id => 3, :name => ''Slander'') ] @post = Post.new(:id => ''1'', :title => ''Foo'', :section => @sections[0]) @controller = Class.new do def url_for(options, *parameters_for_method_reference) url = "http://www.example.com/" url << options[:action].to_s if options and options[:action] url end end @controller = @controller.new end But I''m not able to use this setup as ActionView::Helpers::InstanceTag uses a method of CGI to get to the...
2006 Jul 18
16
Session is being shared between tabs!!??
I have just spotted quite a serious problem with my rails app. My app uses the session to store information. Most people who use the app may have more than one instance of it open in their browser (multiple tabs). The session stores which country the user has selected. On each browser tab the user may select a different country. You can add items to a country. There are problems with
2006 Jan 01
11
Can rails make use of accesskeys?
I added :accesskey=>"D" to the html options hash of my link_to tag but nothing happened. Should I keep trying or is this not an option yet? bruce