Module: Adminpanel::RestActionsHelper

Included in:
ApplicationController
Defined in:
app/helpers/adminpanel/rest_actions_helper.rb

Instance Method Summary collapse

Instance Method Details

#createObject



22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/helpers/adminpanel/rest_actions_helper.rb', line 22

def create
    create! do |success, failure|
      success.html do
      	flash.now[:success] = I18n.t("action.save_success")
        render "shared/index"
      end
      failure.html do
			set_collections
      	render "shared/new"
		end
    end
end

#destroyObject



57
58
59
60
61
# File 'app/helpers/adminpanel/rest_actions_helper.rb', line 57

def destroy
	destroy! do |format|
		format.html { render "shared/index" }
	end
end

#editObject



35
36
37
38
39
40
41
42
# File 'app/helpers/adminpanel/rest_actions_helper.rb', line 35

def edit
    edit! do |format|
      format.html do
      	set_collections
      	render "shared/edit"
      end
    end
end

#indexObject



3
4
5
6
7
# File 'app/helpers/adminpanel/rest_actions_helper.rb', line 3

def index
    index! do |format|
      format.html { render "shared/index" }
    end
end

#newObject



15
16
17
18
19
20
# File 'app/helpers/adminpanel/rest_actions_helper.rb', line 15

def new
	set_collections
    new! do |format|
      format.html { render "shared/new" }
    end
end

#showObject



9
10
11
12
13
# File 'app/helpers/adminpanel/rest_actions_helper.rb', line 9

def show
	show! do |format|
		format.html { render "shared/show" }
	end
end

#updateObject



44
45
46
47
48
49
50
51
52
53
54
55
# File 'app/helpers/adminpanel/rest_actions_helper.rb', line 44

def update
    update! do |success, failure|
      success.html do
      	flash.now[:success] = I18n.t("action.save_success")
      	render "shared/index"
      end
      failure.html do
      	set_collections
      	render "shared/edit"
      end
    end
end