Permalink
Browse files

rails active record example updated

  • Loading branch information...
1 parent 5b08096 commit 986721146ad6fd098f87b215a9dfba5f63aaec50 @gernotkogler gernotkogler committed Mar 10, 2012
@@ -10,7 +10,8 @@ gem 'kaminari'
gem 'formtastic'
gem 'jquery-rails'
gem 'beanstalk-client'
-gem 'xapian_db', '>= 1.2.3'
+gem 'xapian_db', '>= 1.2.4'
+gem 'xapian-ruby'
# Use unicorn as the web server
# gem 'unicorn'
@@ -17,4 +17,10 @@ def update
end
end
+ def destroy
+ person = Person.find(params[:id])
+ person.destroy
+ redirect_to :action => 'index'
+ end
+
end
@@ -1,4 +1,5 @@
=semantic_form_for @person do |form|
=form.inputs :name, :first_name, :date_of_birth, :notes
=form.buttons
-=link_to "Back", people_path
+ =link_to "delete", person_path(@person), :method => :delete
+=link_to "Back", people_path
@@ -1,3 +1,4 @@
+# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.

0 comments on commit 9867211

Please sign in to comment.