class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
+
# protect_from_forgery with: :exception
protect_from_forgery with: :null_session
end
class FeedController < ApplicationController
- # skip_before_filter :verify_authenticity_token
-
def index
@feeds = FeedItem.select(:feed_name).distinct
respond_to do |format|
format.rss { render :layout => false }
end
end
-
def show
if FeedItem::valid_feed_name?(params[:feed_name])
end
end
-
def update
if FeedItem::valid_feed_name?(params[:feed_name])
item = FeedItem.in_feed(params[:feed_name]).entitled(params[:title]).take
# private
-
private def create_item
item = FeedItem.new(:feed_name => params[:feed_name],
:title => params[:title],
end
end
-
private def update_item(item)
if item.update_attribute(:description, params[:description])
flash[:notice] = "Element #{params[:title]} updated"
end
end
-
private def destroy_item(item)
if item.destroy
flash[:notice] = "Element #{params[:title]} deleted"