Scaffold driver, redirect to several views

1

I have a little doubt about the part of the drivers on a website that I'm doing image editing. which is based on the user uploading the image, after pressing the button redirects it to the clipping part always sending the image as a parameter to edit it, then redirects it to the editing part and finally the part of writing text, but for some strange reason in the editing part that calls that view: et, when the user clicks the save button, saves the image but does not go to the next view that is the Text view. I'm trying with elsif but it does not pass to the second elsif. Could someone give me some guidance on how to do it better? THANK YOU IN ADVANCE

    
asked by user3930 05.03.2016 в 21:08
source

1 answer

2

On the one hand elsif just like if requires a condition, which you are not writing. That condition is necessary to define when you should enter the first elsif and when in the second.

Finally, I would recommend instead of using conditions and ifs to define what to do in the controller, use different routes and different actions, such as:

class ImageController < ApplicationController
  def create
    # codigo para subir la imagen
    redirect to cortar_imagen_path(@imagen)
  end

  def cortar
    # codigo para cortar la imagen
    redirect to agregar_texto_imagen_path(@imagen)
  end

  def agregar_texto
    ...
  end
end
    
answered by 06.03.2016 в 19:44