<div class="field">
<%= label_tag("Member code") %>
<%= text_field_tag :member_code, nil, class: 'form-control' %>
</div>
<%= link_to "Joint and Personal loan (Ajax not implemented)", jlpl_prints_path(member_code: 'member_code'), :class => "btn btn-danger", method: :post %>
member_code = params[:member_code]
puts"***********Inside controller member_code received is #{member_code} **************"
I missed the last part of your question, yeah it must be inside a form
tag. You can't tell browser to pass a random text box value without it
being inside a form tag or through javascript.
What you're doing now is just passing `member_code` value to
`member_code` parameter through query string
(`/path?member_code=member_code`), completely ignoring the text box.
<%= form_tag "#" do %>
<%= link_to "joint_loan", joint_loan_path(member_code: membercode), method: :post %>
<%= link_to "payment_detail", ............................ %>
<%= link_to "..................................................... %>
<% end %>
On 2016-Jun-22, at 04:20 , Padmahas Bn <padm...@gmail.com> wrote:Hi,
I'm not using any form in this web page. I only have labels, text boxes and links with parameters.
The text_field code is<div class="field">
<%= label_tag("Member code") %>
<%= text_field_tag :member_code, nil, class: 'form-control' %>
</div>
The link_to code is<%= link_to "Joint and Personal loan (Ajax not implemented)", jlpl_prints_path(member_code: 'member_code'), :class => "btn btn-danger", method: :post %>
in the controller I printed member_code to verify whats the value I'm getting.member_code = params[:member_code]
puts"***********Inside controller member_code received is #{member_code} **************"
The thing is its printing the output in the console as
**************Inside controller member_code received is member_code******************
Why is that? I've filled text_field with value 180 but I'm getting the variable itself but not the value of it. Is form_tag is necessary to get this to work?
Thank you.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3e05f0ea-f2f7-401f-b614-0a39a6920788%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.