lib/simple_crud.rb in simple_crud-0.0.2 vs lib/simple_crud.rb in simple_crud-0.1.0
- old
+ new
@@ -3,10 +3,10 @@
def class_name(instance)
instance.class.name.underscore.humanize
end
def create_(instance, path, r) # Save the instance, Redirect_to if save successful, #render template if not successful
- if instance.save
+ if instance.create
redirect_to path, notice: class_name(instance) + " created."
else
render r
end
end