def delete
  @note = Note.find( params[ :id ] )
   @patient = Patient.find( params[ :patient_id ] ) # this is where
I'm trying to pass a parameter
   @note.destroy

   respond_to do |format|
     format.html { redirect_to :action => "index", :patient_id =>
@patient.id }
     format.xml  { head :ok }
   end
end

Try it Out ok


On Fri, Mar 5, 2010 at 5:51 AM, Dudebot <[email protected]> wrote:

> I'm having a strange sort of problem.  I'd like to pass a param when
> I'm deleting a record, but can't seem to do it.
>
> I've tried all sorts of variants of:
>
>  def destroy
>    @note = Note.find( params[ :id ] )
>    @patient = Patient.find( params[ :patient_id ] ) # this is where
> I'm trying to pass a parameter
>    @note.destroy
>
>    respond_to do |format|
>      format.html { redirect_to :action => "index", :patient_id =>
> @patient.id }
>      format.xml  { head :ok }
>    end
>  end
>
> And I've tried all sorts of variants of:
>
> <%= link_to 'Delete', note, :patient_id => @patient, :confirm => 'Are
> you sure?', :method => :delete %>
>
> Which don't work.  Is there any way to pass params through delete?
>
> TIA,
> Craig
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>


-- 
Thanks:
Rajeev sharma

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to