Hello,
I am using the plugin simply Restful. I would like to use also RJS. So i
try to make a li test.
in index.rhtml
Ajouter une nouvelle catégorie
<% form_remote_for :faq_category, :url => faq_category_url, :html =>
{ :method => :post } do |f| %>
<%= error_messages_for (:faq_category) %>
Libelle <%= f.text_field
:libelle_fr %>
La catégories est visible <%= f.check_box(:est_valable) %>
<%= submit_tag ‘ajouter’ %>
<% end %>
<%= link_to_function(‘Annuler’, “Element.toggle(‘add_category’)”)
%>
in my controller
def create
@faq_category = FaqCategory.new params[:faq_category ]
@faq_category.save! #intecepte toutes les erreurs de sauvegardes
redirect_to_index (“nouvelle catégorie crée”) #Redérige à la vue
index
rescue ActiveRecord::RecordInvalid #intercepte les execeptions
render :action => “new”
end
in my RJS ‘new.rjs’
page.alert ‘test’
So when i try to add a new category it’s working however i don’t see the
alert in my new.rjs
Thanks for your help