- options = {}
- options[:url] = @form_url if @form_url
- options.deep_merge!(data: {dialog: params[:dialog]}) if params[:dialog]
- options[:namespace] = params[:namespace] if params[:namespace]

= ekylibre_form_for(resource, options) do |f|
  - if params[:redirect]
    = hidden_field_tag(:redirect, params[:redirect])
  - if local_assigns[:with_continue] && params[:continue]
    - f.add(:submit, :create_and_continue.tl, data: { disable_with: :please_wait.tl }, class: 'primary', name: :create_and_continue)
  - f.add(:submit, :create.tl, data: { disable_with: :please_wait.tl }, class: 'primary')
  - if local_assigns[:with_continue] && !params[:continue]
    - f.add(:submit, :create_and_continue.tl, data: { disable_with: :please_wait.tl }, class: 'primary', name: :create_and_continue)

  = f.fields(params[:form_partial]) if params[:form_partial]
  = f.fields unless params[:form_partial]

  - f.add(:link, :cancel.tl, (params[:redirect] || local_assigns[:cancel_url] || {action: :index}), (params[:dialog] ? {class: 'btn', data: {close_dialog: params[:dialog]}} : {class: 'btn'}))
  = f.actions

- options = {}
- options[:url] = @form_url if @form_url
- options.deep_merge!(data: {dialog: params[:dialog]}) if params[:dialog]
- options[:namespace] = params[:namespace] if params[:namespace]

= ekylibre_form_for(resource, options) do |f|
  - if params[:redirect]
    = hidden_field_tag(:redirect, params[:redirect])
  - if local_assigns[:with_continue] && params[:continue]
    - f.add(:submit, :create_and_continue.tl, data: { disable_with: :please_wait.tl }, class: 'primary', name: :create_and_continue)
  - f.add(:submit, :create.tl, data: { disable_with: :please_wait.tl }, class: 'primary')
  - if local_assigns[:with_continue] && !params[:continue]
    - f.add(:submit, :create_and_continue.tl, data: { disable_with: :please_wait.tl }, class: 'primary', name: :create_and_continue)
 
  - if params[:form_partial]
   = f.fields(params[:form_partial])
  - else
    = f.fields

  - f.add(:link, :cancel.tl, (params[:redirect] || local_assigns[:cancel_url] || {action: :index}), (params[:dialog] ? {class: 'btn', data: {close_dialog: params[:dialog]}} : {class: 'btn'}))
  = f.actions

Use `if/else` instead of if + unless
Use `if/else` instead of if + unless