Module: Ruhl::Rails::ActiveRecord
- Included in:
- Presenter
- Defined in:
- lib/ruhl/rails/active_record.rb
Instance Method Summary collapse
Instance Method Details
#define_paths(model) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/ruhl/rails/active_record.rb', line 13 def define_paths(model) define_action(model, 'show') # show_path(@user) define_action(model, 'update') # update_path(@user) define_action(model, 'delete') # delete_path(@user) define_action("edit_#{model}", 'edit') # edit_path(@user) define_action(model.pluralize, 'index', false) # index_path define_action(model.pluralize, 'create', false) # create_path define_action("new_#{model}", 'new', false) # new_path end |
#error_messages ⇒ Object
8 9 10 11 |
# File 'lib/ruhl/rails/active_record.rb', line 8 def return if presentee.errors.empty? presentee.errors. end |
#error_messages? ⇒ Boolean
4 5 6 |
# File 'lib/ruhl/rails/active_record.rb', line 4 def !presentee.errors.empty? end |