app/controllers/phcscriptcdnpro/script/urls_controller.rb in phcscriptcdnpro-8.0.0 vs app/controllers/phcscriptcdnpro/script/urls_controller.rb in phcscriptcdnpro-8.0.1
- old
+ new
@@ -5,35 +5,35 @@
# Filters & Security
before_action :require_user
before_action :membership_info
before_action :set_script_url, only: [:show, :edit, :update, :destroy]
-
+
# INDEX - Script Authors
def index
script_listing = Script::Listing.find(params[:listing_id])
@script_urls = script_listing.urls
end
-
+
# DETAILED PROFILE - Script Authors
def show
script_listing = Script::Listing.find(params[:listing_id])
@script_url = script_listing.urls.friendly.find(params[:id])
end
-
+
# NEW - Script Athors
def new
script_listing = Script::Listing.find(params[:listing_id])
@script_url = script_listing.urls.build
end
-
+
# EDIT - Script Athors
def edit
script_listing = Script::Listing.find(params[:listing_id])
@script_url = script_listing.urls.find(params[:id])
end
-
+
# POST - Script Athors
def create
@script_listing = Script::Listing.find(params[:listing_id])
@script_url = @script_listing.urls.create(script_url_params)
@script_url.user_id = current_user.id
@@ -44,11 +44,11 @@
redirect_to script_listing_urls_path, notice: 'Author was successfully created.'
else
render :new
end
end
-
+
# PATCH/PUT - Script Athors
def update
@script_url.user_id = current_user.id
@script_url.user_name = current_user.username
@script_url.membership_id = membership_info.id
@@ -57,28 +57,28 @@
redirect_to script_listing_urls_path, notice: 'Author was successfully updated.'
else
render :edit
end
end
-
+
# DELETE - Script Athors
def destroy
@script_listing = Script::Listing.find(params[:listing_id])
@script_url = @script_listing.urls.find(params[:id])
@script_url.destroy
redirect_to script_listing_urls_path, notice: 'Author was successfully destroyed.'
end
-
+
private
-
+
# Common Callbacks
def set_script_url
@script_url = Script::Url.friendly.find(params[:id])
end
-
+
# Whitelists
def script_url_params
- params.require(:script_url).permit(:scripturl, :scripturlrelease, :scripturlcdnupdate. :slug, :user_id, :user_name, :membership_id, :oganization_id, :listing_id, :version_id, :extension_id)
+ params.require(:script_url).permit(:scripturl, :scripturlrelease, :scripturlcdnupdate, :slug, :user_id, :user_name, :membership_id, :oganization_id, :listing_id, :version_id, :extension_id)
end
-
+
end
-end
\ No newline at end of file
+end