0
我在丢失似乎并不能为这个地方找到一个解决方案前添加一个字符串...Rails的 - 在一个形式参数
所有我想要做的是能增加一点问候中我的用户名前面时,他们提出通过外部API形式...所以没有什么是被保存到我的数据库
ALL我希望能够做的是
"Web inquiry from Jon Doe"
,所以我有一个表格
<%= text_field :subject %>
当用户将自己的名字为它并提交表单我的客户可以去哪里它被张贴在外部网站,并看到
"Web inquiry from Jon Doe"
所以我只需要能够钉在
Web inquiry from
部分以表格上的名字?
请帮我...你我唯一的希望
我的继承人控制器
class Website::ContactsController < Website::WebsiteApplicationController
def new
@contacts = Form.new
end
def create
@contacts = Form.new(params[:contacts])
@contacts.post_tickets(params[:contacts])
if @contacts.valid?
flash[:success] = "Message sent! Thank you for conacting us."
redirect_to new_contact_path
else
flash[:alert] = "Please fill in the required fields"
render action: 'new'
end
end
end
我的继承人形式
= form_for(:contacts, url: contacts_path) do |f|
= f.error_messages
= f.label :subject, "Name"
%span{style: 'color: red'} *
= f.text_field :subject, class: "text_field width_100_percent"
%br
%br
= f.label "Email"
%span{style: 'color: red'} *
%br
= f.email_field :email, class: "text_field width_100_percent"
%br
%br
= f.label "Phone"
%br
= f.text_field :custom_field_phone_number_28445, name: 'contacts[custom_field][phone_number_28445]', class: "text_field width_100_percent"
%br
%br
= f.label "Company"
%br
= f.text_field :custom_field_company_28445, name: 'contacts[custom_field][company_28445]', class: "text_field width_100_percent"
%br
%br
= f.label "Question(s), and/or feedback"
%span{style: 'color: red'} *
%br
= f.text_area :description, class: "text_field width_100_percent", style: 'height: 100px;'
%br
%br
= f.submit "Submit", class: 'btn btn-warning'
即时通讯对不起,即时通讯新的....我怎么用这个?我会把它放在控制器还是modeL? – user1502223
可能在视图中显示的位置。 – tadman
= f.text_field:subject,message =“网络查询来自”+ params [:subject] .....那样? – user1502223