Class: CardController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- CardController
show all
- Includes:
- Recaptcha::Verify, Wagn::Location
- Defined in:
- app/controllers/card_controller.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#discard_locations_for, #interrupted_action, #link_to_page, #location_history, #page_path, #previous_location, #save_interrupted_action, #save_location, #url_key_for_location, #wagn_path, #wagn_url
Instance Attribute Details
Returns the value of attribute card.
23
24
25
|
# File 'app/controllers/card_controller.rb', line 23
def card
@card
end
|
Instance Method Details
48
49
50
51
|
# File 'app/controllers/card_controller.rb', line 48
def asset
Rails.logger.info "Routing assets through Wagn. Recommend symlink from Deck to Wagn gem using 'rake wagn:update_assets_symlink'"
send_file_inside Wagn.paths['gem-assets'].existent.first, [ params[:filename], params[:format] ].join('.'), :x_sendfile => true
end
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CORE METHODS
29
30
31
|
# File 'app/controllers/card_controller.rb', line 29
def create
handle { card.save }
end
|
42
43
44
45
46
|
# File 'app/controllers/card_controller.rb', line 42
def delete
discard_locations_for card
params[:success] ||= 'REDIRECT: *previous'
handle { card.delete }
end
|
33
34
35
36
|
# File 'app/controllers/card_controller.rb', line 33
def read
save_location
show
end
|
38
39
40
|
# File 'app/controllers/card_controller.rb', line 38
def update
card.new_card? ? create : handle { card.update_attributes params[:card] }
end
|