similar to: alias_method_chain with i18n

Displaying 20 results from an estimated 300 matches similar to: "alias_method_chain with i18n"

2009 Mar 21
2
ApplicationHelper::WillPaginate (NameError)
What wrong? environment.rb require "will_paginate" application_helper.rb include WillPaginate::ViewHelpers def will_paginate_with_i18n(collection, options = {}) will_paginate_without_i18n(collection, options.merge(:previous_label => I18n.t(:previous), :next_label => I18n.t(:next))) end alias_method_chain :will_paginate, :i18n
2010 May 04
2
Encoding problems, applying a patch, how to???
So, i''m facing issues with encoding, since I need to write an application in portuguese-brazilian. This is the error i''m getting: "incompatible character encodings: UTF-8 and ASCII-8BIT" The curious thing is that i have a few other views with "special" characters, like Á or Ç, and all of them works. I have saved this view using the UTF-8 char encoding and
2012 May 28
1
rendering a partial inside another using render_to_string and (:formats) in controller
I want to clean my code by moving the duplicated lines : partial = render_to_string( :partial => "#{file}", :formats => [:html] ) to the pagination_partials function. ================================================= WORKING CODE: ================================================= def render_format_search_partial(file, options={}) # TODO remove this line to use the one
2010 Jul 20
2
uninitialized constant WillPaginate::LinkRenderer
This is becoming painful. Where the file should be? What should be in it? I am running will_paginate 3.0.pre Here is my current code sitting in initializers/ class WillPaginateRenderer < WillPaginate::LinkRenderer def rel_value(page) "nofollow" end end Thanks for your help, -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed
2009 Dec 29
1
undefined method `alias_method_chain' for I18n::Backend::Simple:Class
Hi, We are running RE: ruby 1.8.7 (2009-06-12 patchlevel 174) [sparc-solaris2.10], MBARI 0x8770, Ruby Enterprise Edition 2009.10 I tried a simple web app with a controller rendering a text and is working in my PC but on the server I get: Error message: undefined method `alias_method_chain'' for I18n::Backend::Simple:Class Exception class: NoMethodError Application root:
2011 Aug 23
2
Where is WillPaginate::Finders ???
Hi All! It''s been a while since I had to ask for help, but I''m back! I''ve finished beta testing my big app and started the transition to production. Everything went fine and the production version was working till I was asked to add another model :-( (Almost a year of beta testing and they only come up with it after moving to production :-D ) I successfully
2009 Jan 20
0
alias_method_chain in Facebooker Causing Stack Level Too Deep
I installed the Facebooker plugin and upon placing it on a staging server, I keep running into stack level too deep errors. It seems to stem from Facebooker using alias_method_chain to override some of the ActionController methods. I believe it''s getting loaded twice causing confusion. I''ve tried various methods include wrapping a unless respond_to?(:method) around the
2006 Dec 26
0
alias_method_chain vs. redefined method with super
I''m trying to fully understand the subtleties of using alias_method_chain to refine method behavior versus redefining a method and calling super. I have a simple data model (a music collection) that I often use to evaluate web frameworks, and I''m trying to get it working on Rails 1.2.0RC1. Specifically, I have three classes which subclass a common Artist class: - Band
2007 Apr 12
0
Does Ferret have problems with #alias_method_chain ?
Hi all, I have this in my class: class Party < AR::B acts_as_ferret :store_class_name => true, :remote => true, :fields => (self.content_columns.map(&:name) rescue []) + %w(main_identifier) class << self # #count is also defined, omitted for clarity def find_with_destroyed_scope(*args) with_destroyed_scope do
2006 Aug 16
0
acts_as_paranoid and alias_method_chain
when i require acts_as_paranoid I''m getting: undefined method `alias_method_chain'' for #<Class:ActiveRecord::Base> (NoMethodError) It happens in acts_as_paranoid''s init.rb. here''s the whole file. the alias_method_chain is near the bottom. please advise. class << ActiveRecord::Base def belongs_to_with_deleted(association_id, options = {})
2009 Oct 21
3
alias_method_chain and ActiveSupport::TestCase
I''m trying to add some functionality to the setup method of all my tests. I added a method called setup_with_ts in the test_helper and chained it using alias_method_chain :setup, :ts and that works great for every test that does not define setup in the test. So for my unit tests i tried also defining the same method setup_with_ts in a class ActiveSupport::TestCase def setup_with_ts
2007 Mar 22
0
`alias_method_chain': undefined method `find' for class `ActiveRecord::Base' (NameError)
I can''t seem to be able to override the :find method in the model base class, for example, in /lib/usermonitor.rb: module ActiveRecord module UserMonitor def self.included(base) base.class_eval do alias_method_chain :find, :user def current_site Thread.current[:user] end end end def find_with_user(*args) ... end end
2007 Jun 12
1
alias_method_chain and Class methods (a Ruby question)
Hello list, I am trying to override the post_form method of Net::HTTP so that it does something before actually doing the post. I tried the following in environments/development.rb module Net class HTTP alias_method_chain :post_form, :intercept def post_form_with_intercept(url, params) # Do something before post logger.info(''About to post at
2008 Mar 28
1
undefined method ''alias_method_chain''
Running Rails 2.0.2, I get this error: ./script/../config/../vendor/plugins/facebooker/lib/facebooker/rails/facebook_url_rewriting.rb:29: undefined method `alias_method_chain'' for ActionController::UrlRewriter:Class (NoMethodError) from /usr/local/rubygems/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' from
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 Dec 27
2
will_paginate working in the opposite way expected
Hi, I am creating a little blogging engine, so I want the most recent posts to display first, so I make a search with :order => ''created_at DESC'' For some reason, will_paginate works the opposite way I expect it to be. I mean the previous / next links are opposite to what I want. What could I be doing wrong? -- Posted via http://www.ruby-forum.com/.
2009 Aug 24
4
will_paginate: pagination links are wrong
I put everything in a pastie to make it a bit more readable: http://pastie.org/593379 This is the gist: Will_paginate doesn''t play quite nice. The first result set is fine, and when I click on one of the paginated links, it returns the following error: Couldn''t find DictatedExam with ID=filter_widget observe_field triggers filter_widget which calls the paginated search.. Which
2012 Feb 23
4
Undefined Method
Hi all, I am currently trying to get a bunch of links to to display all the related console records upon button click so e.g. If a user clicks on the Dreamcast link then I would like it to display all records that have Dreamcast stored as their console. I have the following example code in my index class: <%= link_to ''DREAMCAST'', games_path(:console =>
2012 Feb 09
0
how to rename a method of a module.
I''m using the gem bootstrap-will_paginate and inside this gem there is the initializer: require ''will_paginate/view_helpers/action_view'' module WillPaginate module ActionView def will_paginate(collection = nil, options = {}) options, collection = collection, nil if collection.is_a? Hash # Taken from original will_paginate code to handle if the helper is
2008 Nov 23
4
Strange behavior of alias_method_chains
Greetings. I''ve got very strange behavior of alias_method_chains, and I hope someone will advise me. I have a rails 2.2.2 app created with #rails aliasApp , a class XYZ residing in app/helpers/xyz.rb: <code> class XYZ attr_accessor :name attr_accessor :value def initialize (a, b) puts "in XYZ constructor" self.name = a self.value = b end def a