Skip to content

Instantly share code, notes, and snippets.

@thomasstr
Created May 25, 2013 08:27
Show Gist options
  • Save thomasstr/5648359 to your computer and use it in GitHub Desktop.
Save thomasstr/5648359 to your computer and use it in GitHub Desktop.
def create
@project = Project.new(params[:project])
if @project.valid?
output = Project.myname(@project.project_name)
flash[:notice] = @output
redirect_to projects_url(output)
# render text: @output, location: projects_path(@output)
# redirect_to projects_path
else
render "new"
end
end
@system123
Copy link

output = Project.myname(@project.project_name)
flash[:notice] = @output

Those lines don't make sense. you need to have
flash[:notice] = output
as output is not an instance variable, it is just a local variable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment