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
<fieldset>
<legend>Ajouter une nouvelle catégorie</legend>
<% form_remote_for :faq_category, :url => faq_category_url, :html =>
{ :method => :post } do |f| %>
<%= error_messages_for (:faq_category) %>
<p><label title="libelle">Libelle</label>
<%= f.text_field
:libelle_fr %></p>
<p>La catégories est visible <%= f.check_box(:est_valable)
%></p>
<%= submit_tag ''ajouter'' %>
<% end %>
<p><%= link_to_function(''Annuler'',
"Element.toggle(''add_category'')")
%></p>
</fieldset>
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
--
Posted via http://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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---