robsite

Rails: before_filter mit Parametern

Kleiner Rails Tipp: before_filter akzeptiert auch Blöcke. So kann man den Methoden leicht Parameter übergeben. Der Block bekommt als Parameter den aktuellen Controller:

before_filter {|c| c.do_stuff(param1, param2)}
· rails, webdev ·

You Need the [PHP] Community

Don’t develop in the dark; get out there and meet people. Programming is not just about how many lines you’ve written and what sort of fun tricks you’ve managed to employ. It’s about getting out there and sharing with fellow developers and making the connections and friendships that could save you down the line.

· php, webdev, weisheiten ·
Mastodon