dimanche 19 février 2023

i added function federatedid in my user model by passing session to hide password in the form.html.haml it is giving this error,how to resolve error

I added this function in user.model

def is_federated?(session)
session[:federatedIdHeader].present?
end

My form.html.haml file is this, i am trying to edit the user if it federated by passing the session in 7th line , this is basically in another repo, i am using it as a gem

.user-edit-form
= simple_form_for(editable_user,html: { autocomplete: "off" }) do |f|
%section
  %header
    %h3
      = precede "User Information" do
      -if editable_user.is_federated?(session)
        = link_to "Change Password",main_app.try(:new_password_path)
  .inputs
    = f.input :needs_setup,as: :hidden,input_html: { value: false }
    = f.input :name,required: true
    = f.input :email,disabled: true
    = f.input :phone,label: "Phone Number"
    = f.input :title
- if editable_user_is_authorized?(editable_user)
  %section
    %header
      %h3
        = precede "Company Information" do
          %small (Shared by all users in your company)
    .inputs
      = f.fields_for :account do |a|
        = a.input :name,required: true
        = a.input :url,label: "Web Address",required: true
.actions
  = f.button :submit, "Save Profile", class: "button little green"

i am getting this error while deploying

users/edit/_form.html.haml:7: syntax error, unexpected ')' ));}\n", 0, false);if 
editable_user.is_federated?(session) 

/edit/_form.html.haml:9: syntax error, unexpected ')', expecting keyword_end ));}\n", 0, 
false);end;

How to make it work

Aucun commentaire:

Enregistrer un commentaire