Class: AtomSmasher::FeedsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- AtomSmasher::FeedsController
- Defined in:
- app/controllers/atom_smasher/feeds_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/atom_smasher/feeds_controller.rb', line 22 def create @feed = Feed.new(params[:feed]) respond_to do |format| if @feed.save format.html { redirect_to feeds_path, notice: 'Experiment was successfully created.' } format.json { render json: @feed, status: :created, location: @feed } else format.html { render action: "new" } format.json { render json: @feed.errors, status: :unprocessable_entity } end end end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/atom_smasher/feeds_controller.rb', line 6 def index @feeds = Feed.all end |
#new ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/controllers/atom_smasher/feeds_controller.rb', line 14 def new @feed = Feed.new respond_to do |format| format.html # new.html.erb format.json { render json: @feed } end end |