Created
July 9, 2013 23:41
-
-
Save thomasbiddle/5962300 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using friendly IDs to translate the name in the route to the ID. | |
project_name = params[:id].to_s | |
if Project.where('name like ?', project_name).empty? | |
@project = Project.new | |
@project.name = project_name | |
notify("info", "Project does not exist - Create one!") | |
return render :action => 'new' | |
else | |
@project = Project.where('name like ?', project_name).first | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment