• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
USER ALERTS IN RAILS WITH MESSAGE BLOCK 
Monday, February 7, 2011
 
 WHAT USER ALERTS?
Flash Messages:ActiveRecord Errors:
<%ifflash[:notice] %>  <p><%= h flash[:notice] %></p> <%end%>flash[:notice]= "User Created" classUser < ActiveRecord::Base validates_presence_of :login end<% form_for(@user)do|f| %> <%= error_messages_for:user%><%end%>
Monday, February 7, 2011
 
MESSAGE BLOCK FEATURES
Merges AR errors and flash messages together 
Groups by message type (confirm, error, warn, etc.)
Accepts flashes with array of strings
Pull AR errors from multiple models
Update via JavaScript for easy Ajax
Monday, February 7, 2011
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...