title: Persistent variables in Rails 3
body: <pre><code>def edit
      @title ="Edit account"
      @page_name = "edit"    
    end
  
    def update
      if @wsp.update_attributes(params[:wsp])
        # it worked
        flash[:success] = "Profile updated."
        if (@title == "Location")
          redirect_to wsp_location_path
        else
          redirect_to edit_wsp_path
        end
      else 
        @title = "Edit account"
        render 'edit'
      end
    end
  </code></pre>
  
  <p>The variable @title is empty when in the update method. How can I make the @title persistent so I can read it?</p>