Ramaze / ramaze

Ramaze is a simple, light and modular open-source web application framework written in Ruby.
http://ramaze.net
371 stars 37 forks source link

Flashbox Documentation #64

Closed jlebrech closed 11 years ago

jlebrech commented 11 years ago

The session section of the documentation mentions how to write to 'flash' and how to customize the flashbox using traits, but I doesn't explain how that flashbox is displayed? How does that look like from a view/layout?

royw commented 11 years ago

Here's a layout/default.haml from one on my projects that uses the flashbox:

%html %head %meta(charset='utf-8') %title= @title = css('reset') = css('grid') = css('layout') = css('text') %body .container

container.row

    #top.grid_12
      %header
        %h1.grid_3= @title
        %nav#nav.grid_8.last
          %ul.clearfix
            = @params[:nav].map{|link| "<li><a href='#{link[:url]}'>#{link[:name]}</a></li>"}.join("\n")
    = flashbox.split(/\n/).join("<br/>\n")
    #content.grid_12
      = @content
    %footer#footer
      %p
        .title Working Together

And the CSS for the flash from (layout.css):

.flash { color:red; margin:10px; }

HTH, Roy

On Jan 25, 2013, at 11:03 AM, Joseph Le Brech notifications@github.com wrote:

The session section of the documentation mentions how to write to 'flash' and how to customize the flashbox using traits, but I doesn't explain how that flashbox is displayed? How does that look like from a view/layout?

— Reply to this email directly or view it on GitHub.

jlebrech commented 11 years ago

Thanks, this part needs to be in the docs On Jan 25, 2013 5:44 PM, "Roy Wright" notifications@github.com wrote:

Here's a layout/default.haml from one on my projects that uses the flashbox:

%html %head %meta(charset='utf-8') %title= @title = css('reset') = css('grid') = css('layout') = css('text') %body .container

container.row

top.grid_12

%header %h1.grid_3= @title %nav#nav.grid_8.last %ul.clearfix = @params[:nav].map{|link| "

  • <a href='#{link[:url]}'>#{link[:name]}
  • "}.join("\n") = flashbox.split(/\n/).join("
    \n")

    content.grid_12

    = @content %footer#footer %p .title Working Together

    And the CSS for the flash from (layout.css):

    .flash { color:red; margin:10px; }

    HTH, Roy

    On Jan 25, 2013, at 11:03 AM, Joseph Le Brech notifications@github.com wrote:

    The session section of the documentation mentions how to write to 'flash' and how to customize the flashbox using traits, but I doesn't explain how that flashbox is displayed? How does that look like from a view/layout?

    — Reply to this email directly or view it on GitHub.

    — Reply to this email directly or view it on GitHubhttps://github.com/Ramaze/ramaze/issues/64#issuecomment-12712016.