Mooooore resources

This commit is contained in:
2014-02-09 05:01:52 -07:00
parent a2cbcac798
commit 2c4cd4a020
7 changed files with 63 additions and 11 deletions

View File

@@ -1,11 +1,16 @@
class ResourcesController < ApplicationController
load_and_authorize_resource
before_filter :authenticate_user!, :load_users
before_filter :load_users
def index
@featured_resource = @resources.where("picture_file_name IS NOT NULL").sample
end
def new
# don't get too excited... for some reason this gets set to the current_user
@resource.user_id = nil
end
def create
authorize! :create, @resource