From: Ben Beltran Date: Sat, 29 Oct 2011 04:00:09 +0000 (-0500) Subject: Changes method for datamapper X-Git-Url: https://git.r.bdr.sh/rbdr/grita/commitdiff_plain/9316ecf28350d6f4e22774e9c53283a0628e10a6?hp=ca2464dd7b09e44661c283d950585cd925e7cb12 Changes method for datamapper --- diff --git a/grita.rb b/grita.rb index 76f1c93..180fe19 100644 --- a/grita.rb +++ b/grita.rb @@ -17,8 +17,7 @@ get '/' do end post '/' do - @grito = Grito.new(:title => params[:title], :text => params[:text]) - @grito.save + @grito = Grito.create(:title => params[:title], :text => params[:text]) haml :index end diff --git a/views/error.haml b/views/error.haml index ed2713f..7de3a5b 100644 --- a/views/error.haml +++ b/views/error.haml @@ -1,4 +1,2 @@ %h1 ERROR -%p Un error ha ocurrido. Revisa que la página esté bien escrita. -%p - =env['sinatra.error'] \ No newline at end of file +%p Un error ha ocurrido. Revisa que la página esté bien escrita. \ No newline at end of file