0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

slim改修する事になってテンパった備忘

Posted at

slimで改修せねばいけなくて、
滅茶苦茶テンパって焦ったので備忘を兼ねて書きます

下の様に書いて動かない、なんでじゃ…と慌ててましたが

    - client_invitations.each do |invitation|
      - invitee_client = ::Reach::Client.find_by(id: invitation.invitee_client.try(:id))
      tr
        td= invitation.id
        td= invitation.client_contract_entry_id
        td= "#{invitation.inviter_client.name}: #{invitation.inviter_client.id}"
        td= "#{invitation.invitee_client.try(:name)}: #{invitation.invitee_client.try(:id)}"
        - if invitee_client.try(:client_page_layout).present? && invitee_client.client_page_layout.page_publish_status.publication?
          td.link= link_to 'URL', show_user_frontend_reach_client_url(invitee_client.client_page_layout.url_name), target: 'blank'
        - else
          td= '非公開'
        td= l invitation.approved_at
        td= l invitation.first_published_at
        td= l invitation.payment_flag ? '支払済' : '未払い'
        td=
           = link_to '支払済', backend_reach_invitation_path(invitation), method: :put, params: {payment_flag: false}, class: 'btn btn-danger form-control'
           .button-margin
           = link_to '未払い', backend_reach_invitation_path(invitation), method: :put, params: {payment_flag: false}, class: 'btn btn-info form-control'

invitation.payment_flag ?のlいらなかったし、
最後のtd =が多かったでそら動きませんわー!

        tbody
    - client_invitations.each do |invitation|
      - invitee_client = ::Reach::Client.find_by(id: invitation.invitee_client.try(:id))
      tr
        td= invitation.id
        td= invitation.client_contract_entry_id
        td= "#{invitation.inviter_client.name}: #{invitation.inviter_client.id}"
        td= "#{invitation.invitee_client.try(:name)}: #{invitation.invitee_client.try(:id)}"
        - if invitee_client.try(:client_page_layout).present? && invitee_client.client_page_layout.page_publish_status.publication?
          td.link= link_to 'URL', show_user_frontend_reach_client_url(invitee_client.client_page_layout.url_name), target: 'blank'
        - else
          td= '非公開'
        td= l invitation.approved_at
        td= l invitation.first_published_at
        td= invitation.payment_flag ? '支払済' : '未払い'
        td=
           = link_to '支払済', backend_reach_invitation_path(invitation), method: :put, params: {payment_flag: false}, class: 'btn btn-danger form-control'
           .button-margin
           = link_to '未払い', backend_reach_invitation_path(invitation), method: :put, params: {payment_flag: false}, class: 'btn btn-info form-control'


    tbody
    - client_invitations.each do |invitation|
      - invitee_client = ::Reach::Client.find_by(id: invitation.invitee_client.try(:id))
      tr
        td= invitation.id
        td= invitation.client_contract_entry_id
        td= "#{invitation.inviter_client.name}: #{invitation.inviter_client.id}"
        td= "#{invitation.invitee_client.try(:name)}: #{invitation.invitee_client.try(:id)}"
        - if invitee_client.try(:client_page_layout).present? && invitee_client.client_page_layout.page_publish_status.publication?
          td.link= link_to 'URL', show_user_frontend_reach_client_url(invitee_client.client_page_layout.url_name), target: 'blank'
        - else
          td= '非公開'
        td= l invitation.approved_at
        td= l invitation.first_published_at
        td= invitation.payment_flag ? '支払済' : '未払い'
        td
           = link_to '支払済', backend_reach_invitation_path(invitation, payment_flag: true), method: :put, class: 'btn btn-danger form-control'
           .button-margin
           = link_to '未払い', backend_reach_invitation_path(invitation, payment_flag: false), method: :put, class: 'btn btn-info form-control'

最後にconfirmつけておしまいっ!
slimが来てもテンパらないようにします

    tbody
    - client_invitations.each do |invitation|
      - invitee_client = ::Reach::Client.find_by(id: invitation.invitee_client.try(:id))
      tr
        td= invitation.id
        td= invitation.client_contract_entry_id
        td= "#{invitation.inviter_client.name}: #{invitation.inviter_client.id}"
        td= "#{invitation.invitee_client.try(:name)}: #{invitation.invitee_client.try(:id)}"
        - if invitee_client.try(:client_page_layout).present? && invitee_client.client_page_layout.page_publish_status.publication?
          td.link= link_to 'URL', show_user_frontend_reach_client_url(invitee_client.client_page_layout.url_name), target: 'blank'
        - else
          td= '非公開'
        td= l invitation.approved_at
        td= l invitation.first_published_at
        td= invitation.payment_flag ? '支払済' : '未払い'
        td
           = link_to '支払済', backend_reach_invitation_path(invitation, payment_flag: true), method: :put,
                   class: 'btn btn-danger form-control', 'data-confirm' => '本当に支払済にしますか?'
           .button-margin
           = link_to '未払い', backend_reach_invitation_path(invitation, payment_flag: false), method: :put,
                   class: 'btn btn-info form-control', 'data-confirm' => '本当に未払いにしますか?'
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?