Class: AtomSmasher::FeedsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/atom_smasher/feeds_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



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

#indexObject



6
7
8
# File 'app/controllers/atom_smasher/feeds_controller.rb', line 6

def index
  @feeds = Feed.all
end

#newObject



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

#showObject



9
10
11
12
# File 'app/controllers/atom_smasher/feeds_controller.rb', line 9

def show
  @feeds = Feed.all
  @feed = Feed.find(params[:id])
end