class ReleasesController < ApplicationController def index @plugin = Plugin.find(params[:plugin_id]) @release = @plugin.sorted_releases.reverse end def show @plugin = Plugin.find(params[:plugin_id]) @release = Release.find(params[:id]) end def edit @release = Release.find(params[:id], :include => [:plugin]) render :action => 'edit', :layout => 'one_column' end def update @release = Release.find(params[:id]) if @release.update_attributes(params[:release]) flash[:notice] = 'Plugin release updated successfully' redirect_to :action => 'show', :id => @release.id else flash[:error] = 'There were problems updating this release:' render :action => 'edit', :layout => 'one_column' end end end