Hi Everyone,
I have created a custom action within one of my controllers as follows:
# GET /kases/discharge/1
# GET /kases/discharge/1.xml
def discharge
@kase = Kase.find_by_jobno(params[:id])
respond_to do |format|
format.html { } # discharge.html.erb
format.xml { render :xml => @kase }
format.pdf { render :layout => false }
prawnto :prawn => {
:background => "#{RAILS_ROOT}/public/images/discharge.png",
:left_margin => 0,
:right_margin => 0,
:top_margin => 0,
:bottom_margin => 0,
:page_size => 'A4' }
end
end
For the edit actions etc the link would be
link_to edit_kase_path(@kase)
Is there a way of linking to the discharge action already, or do I have to make a custom route?
Thanks,
Danny