Guest User

Untitled

a guest
Apr 16th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. class ComentariosController < ApplicationController
  2. # POST /comentarios
  3. def create
  4. @comentario = Comentario.new(params[:comentario])
  5. @comentario.usuario = current_usuario
  6.  
  7. respond_to do |format|
  8. if @comentario.save
  9. flash[:notice] = 'Tu comentario se ha creado.'
  10. else
  11. flash[:error] = 'Ha habido errores al guardar tu comentario'
  12. end
  13. format.html { redirect_to(@comentario.pastie) }
  14. end
  15. end
  16. end
Add Comment
Please, Sign In to add comment