Git Product home page Git Product logo

bootstrap_flash_messages's People

Contributors

aim-up avatar anderson avatar awesome avatar mhuggins avatar robinbrouwer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bootstrap_flash_messages's Issues

Multiple error messages

Hello,

How should I use bootstrap_flash_messages when I have various error messages I'd like to display depending on the error? For example "E-mail address is mandatory." and "E-mail address is invalid."?

Thanks for your help,
David

translation missing: en.flash_messages.defaults.notice

I get this message when trying to show :flash => :notice from private message. Everything else seems to work perfectly...

def set_standard
@standard = Standard.for(current_user).find(params[:id])
rescue ActiveRecord::RecordNotFound
redirect_to(standards_path, :flash => :notice)
end

standards:
create:
success: "Reliability Standard has been created."
error: "Reliability Standard has not been created."
update:
success: "Reliability Standard has been updated."
error: "Reliability Standard has not been updated."
destroy:
success: "Reliability Standard has been deleted."
set_standard:
notice: "The Reliability Standard you were looking for could not be found."

Newline support / html support

Hey,

Would appreciate support for either newlines (converting \n-s into br-s) or html notice messages. I need new lines in my notice and wasn't able to find a way to achieve it, but I want to keep using your gem.

Thanks!

Rails flash mapping should translate better or be configurable

The default rails flash methods are :notice and :error. Currently, when using these in bootstrap_flash_messages, :error renders correctly as alert-error, but :notice renders a normal yellow bootstrap alert. Because the default rails flash is binary (success or fail), shouldn't any flash[:notice]s translate to a bootstrap alert-success?

If you don't want to do this by default, can you consider adding a configuration dictionary that will map any style to any bootstrap alert style? Something in an initializer like:

BootstrapFlashMessages.configuration.do |config|
  config.alert_style_mapping = { :notice => :success, :foo => :info }
end

Then when displaying the alert class in the view, you can just look at the configuration to see if there is an override for the key. In this case, flash[:notice] would have an alert-success class and flash[:foo] would have a alert-info class. Thoughts?

assert redirected failed

Sometimes we need to use

    assert_redirected_to any_url

But when I have flash message, URL seems like any_url?flash=success. Than my test is failed.

    assert_redirected_to "any/url?flash=success"

is bad idea.

error in before_filter method

error in before_filter method looks for error in target method, not before_filter method

#1) in rails controller
before_filter :default
def default
   if error = true
      redirect_to root_path, :flash => :error
   end
end
def index; end

#2) browser attempts to hit controller#index but errors in default

#3) renders root_path view with this flash:
# "translation missing: en.flash_messages.controller_name.index.error

should the flash be: "translation missing: en.flash_messages.controller_name.default.error?

:close option

raw('×')
close = link_to(raw('×'), "#", :class => "close", :data => { :dismiss => "alert" })

oooh! parser ....
& t i m e s ; = ×

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.