Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7649929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:07:10+00:00 2026-05-31T11:07:10+00:00

I am using inline haml templates in my sinatra app. I have a @@layout

  • 0

I am using inline haml templates in my sinatra app. I have a @@layout with a section like this:

#message
  - if flash[:notice]
    %section.notice= flash[:notice]
  - if flash[:error]
    %section.error= flash[:error]

When I use flash[:notice] = “Hello!” in a route & click on a link, the next page happily says Hello” in the #message div. great.

So here is the problem, I am using right.js to add some ajax niceness to my app, The behavior of rack-flash is inconsistent at best.

Most of the time, you click a link (.linkey), a little bit of javascript intercepts it & loads into a #content div (this part works as well), then the ‘#message’ div is reloaded & the flash for the previous action is displayed… the next time you click a link… about 80% of the time, the rest of the time nothing is displayed.

This is my js:

"a.linkey".onClick(function(event) {
   event.stop();
   $('content').load( [ "/", this.get('id'), ].join("") );
   $('message').load( '/message' );
});

I would like is something like this:

1) Click link

2) the link target (/foo) is loaded into #content

3) #message is reloaded with the message (from the route flash[:notice] = “bar”)

4) #content now displaying /foo & #message displays “bar”

I have also tried this with $('message').load( '/message' ); but that either loads nothing into #message or fills #message with “/message” (a string not the contents).

I would like to know what is going on here? Is it something with rack-flash or right.js? or something else? I can provide more code if needed but there really isn’t much more beyond the basic framework as I am just starting on this project.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:07:11+00:00Added an answer on May 31, 2026 at 11:07 am

    For AJAX requests running through a controller action, you’d need to use flash.now so that the flash message will be available for the current request. So in your case, flash.now[:notice] = "bar".

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to use CSS's 'content' property using inline CSS something like this:
I am hiding an element using inline css, like so: <span class=hidden-nojs style=display:none>Some text</span>
Using HTML and CSS. I have text surrounded by a border using display:inline to
I am using VB9's inline XML, and I have a need to specify a
I'm using this jQuery inline datePicker plugin sample but I don't know how to
When using linq and you have c.Sort() Is there any good inline way of
I'm using inline calendar of this jQuery inline datePicker plugin. By default the days
I have a function using inline assembly: vec8w x86_sse_ldvwu(const vec8w* m) { vec8w rd;
I am using inline assembly in Visual C++ and have been trying for days
How does one implement alloca() using inline x86 assembler in languages like D, C,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.