Hello everyone!
I''m trying to create an after filter for all my actions in all
controllers. I put it in application controller (application.rb).
class ApplicationController < ActionController::Base
after_filter :tidyit
def tidyit
xxxx # syntax error - intentionally
end
end
I have a Example (example_controller.rb) controller with index action.
class ExampleController < ActionController::Base
def index
@result = "Hello, world!"
end
end
When I try to access server:3000/example/index I see my hello world
string. But it should be compile error (see "xxxx" in filter code). No
matter what I do inside the filter, this filter is not applied at all!
I''m very puzzled.
I do restart webrick after modifications to the controllers.
ruby 1.8.4 (2005-12-24) [i686-linux]
rails 1.0.0
--
olegf
xxxx is undefined, so that method is probably just returning nil? On 4/14/06, Oleg Frolov <leopardus.vulgaris@gmail.com> wrote:> > Hello everyone! > > I''m trying to create an after filter for all my actions in all > controllers. I put it in application controller (application.rb). > > class ApplicationController < ActionController::Base > after_filter :tidyit > > def tidyit > xxxx # syntax error - intentionally > end > end > > I have a Example (example_controller.rb) controller with index action. > > class ExampleController < ActionController::Base > def index > @result = "Hello, world!" > end > end > > When I try to access server:3000/example/index I see my hello world > string. But it should be compile error (see "xxxx" in filter code). No > matter what I do inside the filter, this filter is not applied at all! > > I''m very puzzled. > > I do restart webrick after modifications to the controllers. > > ruby 1.8.4 (2005-12-24) [i686-linux] > rails 1.0.0 > > -- > olegf > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060414/26320be1/attachment.html
No, this xxxx was just my last try. I can place anything in this method, and it is still ignored. Very strange :| On 4/14/06, Shane Sherman <wtf242@gmail.com> wrote:> xxxx is undefined, so that method is probably just returning nil? > > > On 4/14/06, Oleg Frolov <leopardus.vulgaris@gmail.com > wrote: > > > Hello everyone! > > I''m trying to create an after filter for all my actions in all > controllers. I put it in application controller (application.rb). > > class ApplicationController < ActionController::Base > after_filter :tidyit > > def tidyit > xxxx # syntax error - intentionally > end > end > > I have a Example (example_controller.rb) controller with index action. > > class ExampleController < ActionController::Base > def index > @result = "Hello, world!" > end > end > > When I try to access server:3000/example/index I see my hello world > string. But it should be compile error (see "xxxx" in filter code). No > matter what I do inside the filter, this filter is not applied at all! > > I''m very puzzled. > > I do restart webrick after modifications to the controllers. > > ruby 1.8.4 (2005-12-24) [i686-linux] > rails 1.0.0 > > -- > olegf > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >