Class: Phcscriptcdnpro::Script::ListingsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/phcscriptcdnpro/script/listings_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_user, #get_member_profile_info, #membership_info, #new_login_url, #phcpress_recent_posts, #require_user

Instance Method Details

#createObject

POST - Script Listings



29
30
31
32
33
34
35
36
# File 'app/controllers/phcscriptcdnpro/script/listings_controller.rb', line 29

def create
	@script_listing = Script::Listing.new(script_listing_params)
	if @script_listing.save
		redirect_to script_listings_path, notice: 'Listing was successfully created.'
		else
			render :new
	end
end

#destroyObject

DELETE - Script Listings



48
49
50
51
# File 'app/controllers/phcscriptcdnpro/script/listings_controller.rb', line 48

def destroy
	@script_listing.destroy
	redirect_to script_listings_path, notice: 'Listing was successfully destroyed.'
end

#editObject

EDIT - Script Listings



25
26
# File 'app/controllers/phcscriptcdnpro/script/listings_controller.rb', line 25

def edit
end

#indexObject

INDEX - Script Listings



11
12
13
# File 'app/controllers/phcscriptcdnpro/script/listings_controller.rb', line 11

def index
	@script_listings = Script::Listing.all
end

#newObject

NEW - Script Listings



20
21
22
# File 'app/controllers/phcscriptcdnpro/script/listings_controller.rb', line 20

def new
	@script_listing = Script::Listing.new
end

#showObject

DETAILS - Script Listings



16
17
# File 'app/controllers/phcscriptcdnpro/script/listings_controller.rb', line 16

def show
end

#updateObject

PATCH/PUT - Script Listings



39
40
41
42
43
44
45
# File 'app/controllers/phcscriptcdnpro/script/listings_controller.rb', line 39

def update
	if @script_listing.update(script_listing_params)
		redirect_to script_listings_path, notice: 'Listing was successfully updated.'
		else
			render :edit
	end
end