Adding a string in front of a parameter for a form

前端 未结 2 1373
南方客
南方客 2021-01-25 22:06

I want to add a string in front of a paramemter on my form so that when the user submits something on the form, it posts to an external API and my client can log in to freshdesk

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-25 22:36

    You should do this in your model by adding your substring before the value que form will send you. This seems business logic, it shouldn't be in the view.

    def post_tickets(params)
       client.username = "Hello From, " + client.username
       client.post_tickets(params)
    end
    

提交回复
热议问题