Hi I haveJust attmpting to start using edge rails for the first time. Couldnt find the answer to this anywhere, below is a small peiece of code I have been using, but flash[:notice] does not seem to work anymore What should i be using instead? %if flash[:notice] || flash[:alert] -%> <p id="flashMessage" class="message <%= flash[:notice] ? ''good'' : ''bad'' -%>"> <%= flash[:notice] || flash[:alert] %> </p> <% end -%> cheers -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
flash is just a hash. Rails doesn''t do anything specific if there''s a key named :notice. There''s something else wrong with your code. Can we see the related controller? Jason On 5/2/07, josh <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hi > > I haveJust attmpting to start using edge rails for the first time. > > Couldnt find the answer to this anywhere, below is a small peiece of > code I have been using, but flash[:notice] does not seem to work anymore > > What should i be using instead? > > %if flash[:notice] || flash[:alert] -%> > <p id="flashMessage" class="message <%= flash[:notice] ? ''good'' : > ''bad'' -%>"> > <%= flash[:notice] || flash[:alert] %> > </p> > <% end -%> > > cheers > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jason Roelofs wrote:> flash is just a hash. Rails doesn''t do anything specific if there''s a > key > named :notice. There''s something else wrong with your code. Can we see > the > related controller? > > JasonThis is the code from one of the broken controllers # # POST /blogs # POST /blogs.xml def create @blog = Blog.new(params[:blog]) respond_to do |format| if @blog.save flash[:notice] = ''Blog post was successfully created.'' format.html { redirect_to blog_url(@blog) } format.xml { head :created, :location => blog_url(@blog) } else format.html { render :action => "new" } format.xml { render :xml => @blog.errors.to_xml } end end end -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---