Giter VIP home page Giter VIP logo

devise-bootstrap-form's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

devise-bootstrap-form's Issues

Get rid of the wrapper

The wrapper around all the forms may be a good idea for one use case, but it's not really generalizable. For example, if you want the login to appear both stand-alone, and in the middle of the landing page, you might want to use the same views but rendered in different contexts.

Also, we might not want the same context for all the views. The password reset, resend confirmation, etc. views may have a different look than the simple sign-in/sign-up views.

It might be better to just document ways to address how to make the views consistent without building it into this gem.

`devise_error_messages!` is deprecated

DEPRECATION WARNING: [Devise] `DeviseHelper#devise_error_messages!` is deprecated and will be
removed in the next major version.

Devise now uses a partial under "devise/shared/error_messages" to display
error messages by default, and make them easier to customize. Update your
views changing calls from:

    <%= devise_error_messages! %>

to:

    <%= render "devise/shared/error_messages", resource: resource %>

To start customizing how errors are displayed, you can copy the partial
from devise to your `app/views` folder. Alternatively, you can run
`rails g devise:views` which will copy all of them again to your app.

Spacing and styling of shared links sucks

The shared links don't look that great as links, and the spacing of them sucks if you convert them to buttons. The generated templates could be more friendly to modifying the styles and spacing.

Wrapper partial for views

It would be more flexible if the wrapper for the devise-bootstrap-forms views were a partial around each view:

  • In one place you can custom format the views using Bootstrap classes, using Bootstrap from CDN, and without having to run SASS.
  • It's two lines to strip from each view, instead of six, if you don't want any of devise-bootstrap-form's formatting.
  • It's easier to do a completely custom format around the Devise views.
  • Confirm the partial approach will work.
  • Write the documentation.
  • Make the changes.
  • Release.

Error messages.

We use the default behaviour of bootstrap_form to report errors, meaning that the errors are displayed "in line", in an area below the field that corresponds to the error. The views still have the call to devise_error_messages! in them, so errors are reported twice.

If we remove the call to devise_error_messages!, we still have to account for errors that might not correspond to a field. I believe the Rails documentation suggests that they should get a key of :base in the error collection (need to confirm this).

One solution would be to override devise_error_messages!, but I'm not a fan of magically overriding expected behaviour.

We could create a devise_bootstrap_form_error_messages! that output error messages for :base formatting consistently with the rest of the look and feel of the form.

Bonus marks if this method could detect if the form had the in-line option set, and produce the full set of messages if not. That would imply that the error message method would take the form builder as an argument.

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.