diff --git a/app/controllers/learning_objects/build_controller.rb b/app/controllers/learning_objects/build_controller.rb index cbe0d55e2c2f9d8d14cddde34b5a7fdedd9c27bc..2463a66685c0241c5156e13c8fde94b17acab926 100644 --- a/app/controllers/learning_objects/build_controller.rb +++ b/app/controllers/learning_objects/build_controller.rb @@ -12,8 +12,8 @@ class LearningObjects::BuildController < ::ApplicationController def update @learning_object.update_attributes(learning_object_params) - publish_learning_object if step == steps.last - render_wizard @learning_object + publish @learning_object if step == steps.last + render_wizard @learning_object, notice: update_message end private @@ -22,12 +22,21 @@ class LearningObjects::BuildController < ::ApplicationController @learning_object = LearningObject.unscoped.find(params[:learning_object_id]) end - def publish_learning_object - @learning_object.publish - @learning_object.save + def publish(learning_object) + learning_object.publish + learning_object.save end def learning_object_params params[:learning_object].permit(:thumbnail, :name, :object_type_id, :description, :school_level, :language, :link, topics: []) end + + def update_message + case step + when :upload_attachments + "Seus arquivos foram enviados com sucesso! Agora atualize a imagem do seu conteúdo para finalizar o processo de criação." + when :select_thumbnail + "Parabéns, a imagem foi atualizada e seu conteúdo foi criado com sucesso! Acesse seu perfil e veja todos os objetos criados." + end + end end \ No newline at end of file