ja hallo erstmal,...

Am Freitag, 26. Oktober 2007 schrieb Jan Luehr:
> ja hallo erstmal,..
>
> ich habe in einer Webanwendung link_to überladen, um bei best. actions eine
> Warnung anzuzeigen:
> <code>
>
> def link_to(name, options = {}, html_options = {},
> *parameters_for_method_reference)
>     unless (params[:action] == "list" || options[:safe] == '1' ||
> params[:action] == "index" || params[:action] == "show" )
>       html_options[:confirm]= "Leaving page - input will be lost."
>     end
>     super(name, options,html_options,*parameters_for_method_reference)
>   end
>
> Das funktionierte soweit ganz gut. Nun würde ich jedoch gerne statt der
> Standard-confirm-Funktion eine eigene verwenden. (Um gemachte Änderungen

Für die, die eine Lösung interessiert:
Es muss im application_helper zusätzlich die Methode
def_confirm_javascript_function(confirm) überladen werden - Rückgabewert ist 
der auszuführende JavaScript-Code...

Keep smiling
yanosz
_______________________________________________
rubyonrails-ug mailing list
[email protected]
http://mailman.headflash.com/mailman/listinfo/rubyonrails-ug

Antwort per Email an