app/controllers/phcscriptcdnpro/scriptcdn/urls_controller.rb in phcscriptcdnpro-2.0.0 vs app/controllers/phcscriptcdnpro/scriptcdn/urls_controller.rb in phcscriptcdnpro-2.0.1

- old
+ new

@@ -16,14 +16,10 @@ # New Script URL def new scriptcdn_main = Scriptcdn::Main.find(params[:main_id]) @scriptcdn_url = scriptcdn_main.urls.build - respond_to do |format| - format.html # new.html.erb - format.xml { render :xml => @scriptcdn_main } - end end # Edit Script URL def edit scriptcdn_main = Scriptcdn::Main.find(params[:main_id]) @@ -32,42 +28,31 @@ # POST Script URL def create @scriptcdn_main = Scriptcdn::Main.find(params[:main_id]) @scriptcdn_url = @scriptcdn_main.urls.create(scriptcdn_url_params) - respond_to do |format| - if @scriptcdn_url.save - format.html { redirect_to scriptcdn_main_urls_path, notice: 'Script URL was Successfully Created.' } - format.json { render action: 'show', status: :created, location: @scriptcdn_url } - else - format.html { render action: 'new' } - format.json { render json: @scriptcdn_url.errors, status: :unprocessable_entity } - end + if @scriptcdn_url.save + redirect_to scriptcdn_main_urls_path, notice: 'Script URL was successfully created.' + else + render :new end end # PATCH/PUT Script URL def update - respond_to do |format| - if @scriptcdn_url.update(scriptcdn_url_params) - format.html { redirect_to scriptcdn_main_urls_path, notice: 'Script URL was Successfully Updated.' } - format.json { head :no_content } - else - format.html { render action: 'edit' } - format.json { render json: @scriptcdn_url.errors, status: :unprocessable_entity } - end + if @scriptcdn_url.update(scriptcdn_url_params) + redirect_to scriptcdn_main_urls_path, notice: 'Script URL was successfully updated.' + else + render :edit end end # Delete Script URL def destroy @scriptcdn_main = Scriptcdn::Main.find(params[:main_id]) @scriptcdn_url = @scriptcdn_main.urls.find(params[:id]) @scriptcdn_url.destroy - respond_to do |format| - format.html { redirect_to scriptcdn_main_urls_path, notice: 'Script URL was Successfully Deleted.' } - format.json { head :no_content } - end + redirect_to scriptcdn_main_urls_path, notice: 'Script url was successfully destroyed.' end private # Common Callbacks