Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for flash message #158

Closed
prabirshrestha opened this issue Sep 26, 2022 · 6 comments
Closed

Add support for flash message #158

prabirshrestha opened this issue Sep 26, 2022 · 6 comments

Comments

@prabirshrestha
Copy link
Contributor

This is similar to one popularized by the ruby on rails. https://www.rubyguides.com/2019/11/rails-flash-messages/

rust counter parts:

Initially I'm looking to show flash message when the user sign up or resets the password.

Noticed that one of the sample using it but don't see how it is getting set in the rust world.

{% if flash %}
<small class="field-{{ flash.kind }}-flash">
{{ flash.message }}
</small>

@chrislearn
Copy link
Member

Done

@prabirshrestha
Copy link
Contributor Author

I'm having issues compiling the latest version of salvo.

    Blocking waiting for file lock on build directory
   Compiling salvo_extra v0.36.0
error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position
  --> /Users/.../.cargo/registry/src/github.com-1ecc6299db9ec823/salvo_extra-0.36.0/src/force_https.rs:50:42
   |
50 |         if let Some(host) = req.header::<String>(header::HOST) {
   |                                          ^^^^^^ explicit generic argument not allowed
   |
   = note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information

Disabling defeault-features doesn't seem to work either.

salvo = { version = "0.36.0", default-features = false, features = ["affix", "compression", "caching-headers", "logging", "proxy", "serve-static"] }

@prabirshrestha
Copy link
Contributor Author

I also noticed that some crates use _ while some use - for differentiator. Doesn't matter in code but wanted to mention it for consistency.

https://crates.io/search?q=salvo

@chrislearn
Copy link
Member

rust-lang/crates.io#728
Name can not be changed after they published. Hope it can be changed in future..

@chrislearn
Copy link
Member

You need to upgrade your rust to latest version.

@shujaatak
Copy link

@prabirshrestha @chrislearn I think this issue can be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants