In the controller, you are basically in "ruby-land".  So use the params hash
just as you've used the flash hash:

params[:model_id]
UserMailer.deliver_removeRequest(params[:model_id])

This assume that your usermailer method is expecting the first parameter to
be the model id itself and not the actual model object.  You can pass the
full object to it by using activerecord:
UserMailer.deliver_removeRequest(Model.find_by_id(params[:model_id])

Hope this sheds some light on your issue.  Best of luck.

p.s. "this" is a hobo convention.  In Ruby, the current object is "self"

On Tue, Jun 29, 2010 at 10:34 AM, Pete <[email protected]> wrote:

>
>
> Brilliant, I thought there must be a way of doing something
> similar....
>
> I now have my button as you suggested
>
> <%= button_to "Remove This Model", { :action => "remove", :model_id =>
> "#{this.id}" }, :confirm
> => "Are you sure?" %>
>
> and I'm guessing that this id is now passed to my action - which leads
> to my next issue...
>
> def remove
>  UserMailer.deliver_removeRequest(this)
>  redirect_to "/"
>  flash[:notice] = "We have been notified of your request. You will be
> contacted shortly."
>
>  end
>
>
> It is in the mail delivery issue where I need to pass the id - but how
> do I use params hash within my controller remove method - and more
> specifically UserMailer.deliver_removeRequest(??)?
>
> I thought 'this' would work, but It does not seem to point to
> anything?
>
> Thanks again,
>
> getting there!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Hobo Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<hobousers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/hobousers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en.

Reply via email to