Joined April 2013
·
Posted to
redirect_to, array and the splat operator
over 1 year
ago
You can simplify this further by having your notice called beforehand.
flash[:notice] = ...
You can then return only the urls and therefore remove the arrays, the splat, and the "return" keyword while you are at it.
Achievements
169 Karma
0 Total ProTip Views
Forked 20
Have an established project that's been forked at least 20 times
24PullRequests Participant
Sent at least one pull request during the first 24 days of December 2013
Lemmings 100
Write something great enough to have at least 100 watchers of the project
Nephila Komaci
Have at least one original repos where PHP is the dominant language
Nephila Komaci 3
Have at least three original repos where PHP is the dominant language
Octopussy
Have a repo followed by a member of the GitHub team
Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos
Altruist
Increase developer well-being by sharing at least 20 open source projects
Forked
Have a project valued enough to be forked by someone else
Charity
Fork and commit to someone's open source project in need
Python 3
Have at least three original repos where Python is the dominant language
Python
Would you expect anything less? Have at least one original repo where Python is the dominant language
Mongoose 3
Have at least three original repos where Ruby is the dominant language
Mongoose
Have at least one original repo where Ruby is the dominant language
Cub
Have at least one original jQuery or Prototype open source repo
Raven
Have at least one original repo where some form of shell script is the dominant language
Ashcat
Make Ruby on Rails better for everyone by getting a commit accepted
Exactly! Using
notice:
on redirects is actually a shortcut toflash[:notice]
.I only use the return keyword when I need to explicitly stop a method but it's a question of Ruby-style I guess.