Class: DictionariesController

Inherits:
BaseJsonController show all
Defined in:
app/controllers/dictionaries_controller.rb

Instance Method Summary (collapse)

Methods inherited from BaseJsonController

#destroy, #index, #show, #update

Instance Method Details

- (Object) create

renders submissions/index when @dictionary fails to save redirects to submissions_path when @dictionary saves



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/controllers/dictionaries_controller.rb', line 20

def create
  respond_to do |format|
    format.html do
      @dictionaries = Dictionary.accessible_by current_ability
      unless @dictionary.save
        @submissions = Submission.accessible_by current_ability
        render 'submissions/index'
      else
        redirect_to submissions_path
      end
    end
  end
end