Class: Puffer::Base
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Puffer::Base
show all
- Defined in:
- lib/puffer/backends/controllers/base.rb
Instance Method Summary
collapse
Instance Method Details
#create ⇒ Object
36
37
38
39
40
|
# File 'lib/puffer/backends/controllers/base.rb', line 36
def create
@record = resource.new_member
@record.save
respond_with @record, :location => puffer_saving_location
end
|
#destroy ⇒ Object
48
49
50
51
52
|
# File 'lib/puffer/backends/controllers/base.rb', line 48
def destroy
@record = resource.member
@record.destroy
respond_with @records, :location => (request.referrer || resource.collection_path)
end
|
#edit ⇒ Object
31
32
33
34
|
# File 'lib/puffer/backends/controllers/base.rb', line 31
def edit
@record = resource.member
respond_with @record
end
|
#event ⇒ Object
54
55
56
|
# File 'lib/puffer/backends/controllers/base.rb', line 54
def event
render :text => fields(params[:fieldset])[params[:field]].render(params[:event], self)
end
|
#index ⇒ Object
16
17
18
19
|
# File 'lib/puffer/backends/controllers/base.rb', line 16
def index
@records = resource.collection.page(params[:page]).per(puffer_filters.per_page)
respond_with @records
end
|
#new ⇒ Object
26
27
28
29
|
# File 'lib/puffer/backends/controllers/base.rb', line 26
def new
@record = resource.new_member
respond_with @record
end
|
#show ⇒ Object
21
22
23
24
|
# File 'lib/puffer/backends/controllers/base.rb', line 21
def show
@record = resource.member
respond_with @record
end
|
#update ⇒ Object
42
43
44
45
46
|
# File 'lib/puffer/backends/controllers/base.rb', line 42
def update
@record = resource.member
@record.update_attributes resource.attributes
respond_with @record, :location => puffer_saving_location
end
|