Solved it.
Error was after this line :
- if devise_mapping.confirmable? && resource.pending_reconfirmation?
div's
were not indented, so the if block will not end, hence the error.
Question
When i use devise's
edit user registration slim
file, it gives this error:
Started GET "/users/edit" for 127.0.0.1 at 2014-04-30 00:28:39 +0530
Processing by Devise::RegistrationsController#edit as HTML
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 4 ORDER BY "users"."id" ASC LIMIT 1
Rendered devise/registrations/edit.html.slim within layouts/application (5.0ms)
Completed 500 Internal Server Error in 9ms
ActionView::Template::Error (Multiple your attributes specified):
temple (0.6.7) lib/temple/html/attribute_merger.rb:15:in `block in on_html_attrs'
temple (0.6.7) lib/temple/html/attribute_merger.rb:12:in `each'
temple (0.6.7) lib/temple/html/attribute_merger.rb:12:in `on_html_attrs'
(eval):7:in `dispatcher'
temple (0.6.7) lib/temple/mixins/dispatcher.rb:49:in `compile'
temple (0.6.7) lib/temple/html/dispatcher.rb:26:in `on_html_tag'
(eval):17:in `dispatcher'
temple (0.6.7) lib/temple/mixins/dispatcher.rb:49:in `compile'
temple (0.6.7) lib/temple/mixins/dispatcher.rb:7:in `block in on_multi'
emple (0.6.7) lib/temple/mixins/dispatcher.rb:7:in `each'
temple (0.6.7) lib/temple/mixins/dispatcher.rb:7:in `on_multi'
(eval):32:in `dispatcher'
temple (0.6.7) lib/temple/mixins/dispatcher.rb:49:in `compile'
temple (0.6.7) lib/temple/html/dispatcher.rb:27:in `on_html_tag'
The user Registration slim file is :
h2
| Edit #{resource_name.to_s.humanize}
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
= devise_error_messages!
div
= f.label :email
br
= f.email_field :email, autofocus: true
- if devise_mapping.confirmable? && resource.pending_reconfirmation?
div
| Currently waiting confirmation for: #{resource.unconfirmed_email}
div
= f.label :password
i (leave blank if you dont want to change it)
br
= f.password_field :password, autocomplete: "off"
div
= f.label :password_confirmation
br
= f.password_field :password_confirmation, autocomplete: "off"
div
= f.label :current_password
i (we need your current password to confirm your changes)
br
= f.password_field :current_password, autocomplete: "off"
div= f.submit "Update"
h3 Cancel my account
p
| Unhappy? #{button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete}
= link_to "Back", :back
How to solve this error?
Note : This slim
file is auto-generated.
Solution
Solved it.
Error was after this line :
- if devise_mapping.confirmable? && resource.pending_reconfirmation?
div's
were not indented, so the if block will not end, hence the error.