similar to: before_invocation by block or method

Displaying 20 results from an estimated 100000 matches similar to: "before_invocation by block or method"

2006 Nov 21
2
before_filter in actionwebservice controller using direct dispatching
The docs say that for direct dispatching mode to use controller filters, but when the controller is run I get the following error. The authorize method is in application.rb. Works fine when it''s not a web service api. Should I be using before_invocation instead even with direct dispatching mode? Or can I not have the authorize method in application.rb? undefined method
2008 Jun 15
7
Getting "no block given" on find method - rails 2.1
I am trying to do a simple find through the current_user but get an exception. Either someone spiked my Starbucks coffee and I am screwing up all over the place or there is something wrong. def index @league = current_user.leagues.find(13) end # Error LocalJumpError in Admin/schedule todosController#index no block given If I pass a block to it it works fine, but it is just messy: =====
2006 Sep 10
5
why isn't :order working in acts_as_list
Ok, I''m sure this has to be something stupid that I''m doing (or not doing), but I can''t seem to get things to order by the specified column. class List < ActiveRecord::Base has_many :list_items, :order => "orderby" The error I get back when trying to save the link is: Unknown column ''position'' in ''order clause'':
2007 Oct 24
4
before_filter at the method level
I have used before_filter in the passed at the class level but can it be used in the method level. For example, I want to refuse a non-admin type from being able to delete anything in the entire application. Is there an easy way to do this? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the
2007 Dec 31
3
undefined method `content_type'
I am using form_remote_tag to upload a file, but it says .. undefined method `content_type'' for #<String:0x477a930> what could be wrong when it works fine with form_for? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To
2007 May 06
2
render :action "call method first?"
Hi, I know when I call: render :controller => ''some'', :action => ''thing'' It doesn''t call the method ''thing'' before render the template ''thing.rhtml'', but I need some instance variable which are in the ''thing'' method, how can I let it call the method ''thing'' and then render
2008 Feb 22
7
undefined local variable or method "acts_as_list"?
Hi, I''m getting the error below, and I''m not sure where to find "acts_as_list" ... NameError in SpecialsController#printer undefined local variable or method `acts_as_list'' for #<Class: 0xb7a46994> RAILS_ROOT: /usr/local/apache2/htdocs/dps Application Trace | Framework Trace | Full Trace vendor/plugins/trunk/lib/scope_out.rb:70:in
2008 Dec 15
3
Application failing on undefined method `install_gem_spec_st
Hi there, I have rails 2.0.2 installed on my development server and that is where I created this app. I froze the app to 2.0.2 knowing that my host server uses 2.2.2 and that version breaks my application. But when I upload my app to its test bed on the host server I get this error: # ruby dispatch.cgi ./../config/../vendor/rails/railties/lib/initializer.rb:49:in `send'': undefined
2008 Mar 04
3
remote_form_for does not work with method = :get
It seems that remote_form_for does not work with method = :get since it does not change the prototype call. Is this a bug? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe
2009 Apr 06
9
setup method in functional tests and instance variables
I have the following in my functional test file. class UserControllerTest < ActionController::TestCase fixtures :users def setup @controller = UserController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new @invalid_user = user(:invalid_user) @valid_user = users(:valid_user) end def test_login_success
2007 Sep 19
3
link_to method of different controller
I want to link to a method of a different controller. I thought I new how to do this but the code that I have is not working: <%= link_to ''Welcome Page'', { :action => ''index'', :controller => ''music_controller'' } %> Any ideas, thanks ~S -- Posted via http://www.ruby-forum.com/.
2007 Jan 25
4
How to change the menu depending on the controller/method?
Hello, I''m still dtarting with ruby on rails. And I''m trying to have a menu depending on the current controller/method. Here is what I was thinking of (please tell me if there''s a better way to do it): I have a database with menu_groups (corresponding to controllers) and menu_elements(corresponding to methods). Each menu_element belongs to one menu_group. I created a
2006 Oct 20
2
Calling a method in a gsub?
Ok, so I would like to do something like this: string.gsub(regexp, output(''\0'' ,''\1'', ''\2'') Output returns a string. I tested it in irb and it worked ok. Now when it''s in my application, the ''\1'' and others don''t resolve as backreferences to the matches as they should. How can I fix this? Or go around
2008 Jan 30
1
undefined method `scaffold'
Hello, I have been busy for a while and now I am back to messing with rails. Last time I tried to use scaffold i worked now I am getting this error. Not really sure since I am using version 1.2.5 still NoMethodError in BlogController#index undefined method `scaffold'' for #<BlogController:0x506eb7c> Session dump flash: !map:ActionController::Flash::FlashHash {} Thanks for any
2007 Nov 27
1
Plugin - How to access object from instance method
Quick question: Given a basic plugin... how can I access an object that I instantiated in the acts_as method from an instance method? Probably some sort of accessor... but where? def self.included(base) base.extend ClassMethods end module ClassMethods def acts_as_test object = Object.new ## This object needs to be accessible from the Instance Methods end include
2007 Sep 27
1
How to call a model object method for validation?
This is the code I''m trying to get to work: validates_inclusion_of :status, :in => poll_statuses().keys def poll_statuses return { "closed" => "Closed", "open" => "Open" } end It says there''s no poll_statuses method in Poll. How do I access this method? I''ve tried
2007 Aug 22
2
Sanitize my params and the create method
If I call .create on the param structure, are the parameters being passed to the create method automatically sanitized for me? e.g. Journalentry.create(param[:journalentry]) Do I have to worry about any malicious scripting making its way into the creation of the record? Thanks. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this
2009 Mar 09
4
undefined method `symbol_path'
I am getting following error while creating a new topic using RESTful design. But, everything works fine when I use <% form_tag :action => :create do %> . ActionView::TemplateError (undefined method `symbol_path'' for #<ActionView::Base:0xb72a2e40>) on line #3 of topics/new.rhtml: 1: <h1>New Topic</h1> 2: 3: <% form_tag :topic, :url => topics_path do %>
2007 May 20
1
Jack Slocum's Ext library in Rails
If anyone is familiar with Jack Slocum''s revolutionary Ext javascript library (http://www.extjs.com) and wishes to use it with Rails (instead of the traditional Prototype / Scriptaculous duo), I''ve create a combination vendor/plugin and javascript library to help you. If ye be brave and know how to use SVN: Ext on Rails: http://www.extonrails.com -- Posted via
2006 Dec 14
1
create and destroy fixture manually in method
Hi, My test case has two fixtures and eight methods. But one of the eight methods need one more fixture. How do I solve this? Okay, I put the additional fixture in common place so every method has additional access to the additional fixture. The problem is the additional fixture depend on that two fixtures (foreign key). When I run the test, it complains something like this: