Hey,

Why not try:

def destroy
  id = params[:id]
  render :update do |page|
    page.alert( "THIS TEXT" ) if Job.find(:all, :conditions=>
["type_id=?",id]).size > 0
  end
end


Gavin

http://handyrailstips.com


On Jul 14, 7:21 pm, Mickael Faivre-Macon <rails-mailing-l...@andreas-
s.net> wrote:
> Hi,
>
> In my view I have
>
> link_to_remote(image_tag("trashcan.gif"), :url=>{:action=>'destroy',
> :id=>jobtype.id}, :confirm=>I18n.t(:confirm_action),
> :success=>"$('el_#{jobtype.id}').fade()", :failure=>"alert('HERE I WANT
> THE TEXT GENERATED BY THE CONTROLLER')")
>
> And in the controller:
>   def destroy
>     id = params[:id]
>     render(:text=>"THIS TEXT", :status=>:forbidden) and return if
> Job.find(:all, :conditions=>["type_id=?",id]).size > 0
>     JobType.destroy(id)
>     render(:nothing=>true)
>   end
>
> How can I get the text rendered by the controller ?
>
> response['body'] can not be used here.
>
> Thanks,
> Mickael.
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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