08 Jun '12, 2am

Passing Arguments to before_filter - Ruby Forum:

Hi -- On 3/20/07, s.ross <[email protected]> wrote: > end > end > > Where I'm blocking is on how to get the 'options' data in the do_something > method. I think I can write this as: The way I've done this in the past, which may or may not be the slickest way to do it, is along the lines of: class MyController < ApplicationController before_filter :only => "whatever" do |controller| controller.some_method(1,2,3) end def some_method(a,b,c) ... end end The proc has the controller object itself yielded to it, so you can then call the method on that object with whatever arguments you need. The particular case you've got, where you seem to be testing for whether this controller needs a particular filter, looks like it would probably better handled with skip_before_filter and friends. But anyway, you can grab the controller object and call methods on it directly. David -- Q. What...

Full article: http://www.ruby-forum.com/topic/102047

Tweets

Ruby Inheritance: Ruby Study Notes - Best Ruby ...

rubylearning.com 07 Jun '12, 1pm

Inheritance is a relation between two classes. We know that all cats are mammals, and all mammals are animals. The benefit...

#324 Passing Data to JavaScript - RailsCasts:

railscasts.com 10 Jun '12, 3am

When JavaScript plays a large part in a Rails application it often becomes necessary to pass data from the app on the serv...

Estimated Traffic Net Worth $18,260. Daily Ad R...

domainnameforum.com 10 Jun '12, 4am

Only list traffic domains please. Proof hits and traffic source.

I just used a piece of code @josh_cheek wrote l...

ruby-forum.com 12 Jun '12, 12am

On Aug 19, 2011, at 12:27 PM, Yu Yu wrote: > end > end > end I'm not sure what different action you plan to take if there ...

Learning Ruby and Rails:

everydayrails.com 18 Jun '12, 3am

I live in a town dominated by Python, PHP , and Java developers, so hiring someone who can come in and write Ruby code fro...

Jay Fields' Thoughts: Ruby: Class Methods:

Jay Fields' Thoughts: Ruby: Class Methods:

blog.jayfields.com 17 Jun '12, 5am

The real stumbling block is that Java class methods are totally different things from Ruby "class" methods, so different t...

@polotek @rwaldron @timw4mail Ruby uses # to de...

railstips.org 10 Jun '12, 5pm

The other day I was explaining the difference between class and instance methods to a friend and I realized that I should ...

ステータスコード422のいい話し(この挙動って今も変わってないんだっけ / “第2回 新規アプ...

oiax.jp 12 Jun '12, 6am

Rails 2.0 がインストールできましたので、早速、新規アプリケーションを作ってみましょう。 > rails sample コンソールに次のように表示されて、アプリケーションが作成されました。 create create app/contr...

yup, it's true: we're hiring @dojo4 bennies gal...

rubyforge.org 07 Jun '12, 6pm

okay, funnies aside fill out this application if you're interested in working @dojo4 https://github.com/[ $USERNAME ] prox...

handy way to mock a remote api for testing:

pivotallabs.com 10 Jun '12, 2am

There seems to be a tendency to stub or mock classes when writing integration tests for basic http services. I'm actually ...

The Mega Ruby News and Release Roundup for May ...

rubyinside.com 11 Jun '12, 3pm

JRuby 1.7.0 Preview 1 Released 1.7 is proving to be a big release for JRuby and the first preview is out. A key change is ...