similar to: access a ActionControllers protected method from plugin?

Displaying 20 results from an estimated 200 matches similar to: "access a ActionControllers protected method from plugin?"

2006 May 26
8
calling render_to_string outside of controller
How can I call render_to_string outside of a controller. I''m stuck on this. I''ve nearly got my plugin finished but I can''t seem to get this to work. The method is in ActionController::Base but it is protected. -- Posted via http://www.ruby-forum.com/.
2006 May 31
0
acts_as_blog
ActsAsBlog ========== Here is a simple plugin to allow you to allow the use of RedCloth,BlueCloth, or SmartyPants in your blog. It''s super simple to use. It will take your blog post or comment and transform it into html. This allows you to write in a much simpler syntax and allows your users to post valid html into their comment. It also allows you to block all html tags that
2006 Jun 26
5
How can I dynamiclly generate models?
I am trying to write a plugin, ''acts_as_commentable'', for my models - Image, Book, Music and so on, I do not want to use polymorphic association, so very model should have its own comment class. Here is my code acts_as_commentable.rb module Commentable def self.included(base) base.extend(ClassMethods) end module ClassMethods def
2009 Sep 11
0
Need help with extending a plugin
hey folks I''ve installed the plugin acts_as_taggable_on_steroids (henceforth aatos), and i already have some tagging functionality set up, using the same approach (ie a Tag and a Tagging class with associated tables) as aatos. So, i want my existing Tag and Taggings methods, plus some other methods i have in a module which i include with the taggable classes (ie the ones that would call
2005 Dec 29
3
Why do plugins use class_eval?
I''m writing my own plugin and all the plugins I''ve seen use class_eval in the method that is called in the including module. For example: http://wiki.rubyonrails.com/rails/pages/HowToWriteAnActsAsFoxPlugin module Foo module Acts #:nodoc: module Fox #:nodoc: def self.included(base) base.extend(ClassMethods) end # declare the class level
2006 May 06
3
Extending Rails plugins?
Gents, I''m using the acts_as_taggable rails plugin (not gem), and would like to add some additional methods to it. For example, the find_tagged_with methods essentially does a find tag in a list (effectively an OR), while I''d like to implement a find_tagged_with_all method that would implement an AND (so if I specified 4 tags, it would only return items that were
2006 Sep 04
2
"include" versus "extend" - what's the difference
Hi, Just wondering when one would use "include" over "extend"? Both seem to bring in methods to the class no? The context is I''m just trying to understand why both are used with the acts_as_audited plugin: Full extract from plugin (used within here): ================================================== # Copyright (c) 2006 Brandon Keepers # # Permission is hereby
2006 Mar 28
0
How to set session variable in plug-ins
I''m working on a plug-in which has to manipulate some session varibles Unfortunately I end up with "Symbol as array index" errors. Probably the error occurs in a point that I never think about but here''s an abstract plug-in which generates the same error. It fails in the line of assignment "session[:aaa_uid] = uid" with "Symbol as array index"
2006 Feb 28
0
acts_as_taggable vulnerable to attacks ?
Hi all ! I''d like to confirm if I''m reading correctly. It seems ActiveRecord::Acts::Taggable::SingletonMethods#find_tagged_with is vulnerable to SQL injection attacks: def find_tagged_with(options = {}) options = { :separator => '' '' }.merge(options) tag_names = ActiveRecord::Acts::Taggable.split_tag_names(options[:any] || options[:all],
2006 Feb 16
1
[PATCH] acts_as_taggable plugin
hi, I started today to use the acts as taggable plugin and it''s working as expected. I added a method find_tagged_with_all since I needed to find the elements tagged with all the items in a list while find_tagged_with finds all the elements tagged with any of the list terms. Attached to this mail there''s a patch which adds the find_tagged_with_all method and which solves a
2009 Dec 27
5
Difficulties in understanding Rail-Plugins in depth
Hi, i try to understand how plugins work in detail. Often you see stuff like: class Post < ActiveRecord::Base   acts_as_commentable end I wonder what''s happen all there. What kind of language-feature is behind this call "acts_as_commentable" ? In my opinion you need some kind of extend or include to extend the functionality of a model. And exactly this is which i found
2006 Jun 30
0
find_by_sql not quoting properly (in acts_as_taggable plugin)
I have run into a very strange problem discovered through the use of the acts_as_taggable plugin, but related to quoting/sanitizing the interpolated list in a find_by_sql. Apologies for the length, but I wanted to be complete. ;-) The method from acts_as_taggable.rb is: def find_tagged_with(list) find_by_sql(["SELECT #{table_name}.* FROM #{table_name}, tags,
2006 Feb 07
4
Ruby, Rails & Inheritance
Hi! I am looking for a solution for the following problem: Some of my models share some attributes and also was in need for some extra features, so I created a class "RecordWithFeatures": ----------------------------------------------------------------- class RecordWithFeatures < ActiveRecord::Base # @Override def self.descends_from_active_record? superclass ==
2006 Sep 25
3
Engine Yard blog
Just received the news from Tom Mornini. Congrats Ezra for the new Engine Yard site and the blog you will be collaborating. Hope to read you there soon. http://www.engineyard.com/ Jonathan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060925/3f251fa4/attachment.html
2006 Feb 24
4
Any way to pass state to a component?
I am trying set up a rails app that utilizes components. I need to be able to pass some state (a bunch of name value pairs) from the Main controller to the component. Is there any way to pass this state info using render_component? Regards -- Posted via http://www.ruby-forum.com/.
2007 Oct 16
1
Stub ActionController::Base#params
Has anyone had any success stubbing ActionController::Base#params? The following is not intercepting calls to params[:foo] in my controllers: ActionController::Base.stub!(:params).and_return(:foo => ''bar'') -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071016/282a76ba/attachment.html
2006 Aug 06
1
Where is ActionController::InPlaceEditing?
I can''t find this doc anywhere, but the JavaScriptMacrosHelper doc mentions it. Jose -- Posted via http://www.ruby-forum.com/.
2006 Aug 15
0
Using config.action_controller.asset_host with ActionController::AbstractRequest.relative_url_root
I''m looking for some help with an issue I''m having using an external asset host. I''ve got the lines below in my environments/development.rb file. # Enable serving of images, stylesheets, and javascripts from an asset server config.action_controller.asset_host = "http://assets.example.com" #make rails think it lives in /app
2006 Jul 03
0
ActionController parameters and conditional select
Hello everyone, I''m pretty new to Rails and have been working on my own test app to check things out. I''ve run into a couple of Nuby snags. I''ve looked for the answers but have not found a concise answer to my problem. What I would like to do is to have a table of ''people'' and be able to display a list of ''people'' based on
2006 Jul 04
0
ActionController::UnknownAction hangs application
I''m trying to override rescue_action_in_public() using the PP example, but my application hangs every time I generate an error. def rescue_action_in_public(exception) case exception.class when ActiveRecord::RecordNotFound, ActionController::UnknownAction render( :file => "#{RAILS_ROOT}/public/404.html", :status => "404 Not