Search code examples
htmlruby-on-railscontrolleractionlink-to

Ruby on Rails Button Link to controller doesn't appear


This is weird! I have an html.erb form, and in this form I have a button that links the user to an action in another controller (finance_extensions) to print pdf. This is working great, but the thing is that I need my own action that I'm using in the current controller (parent_wise_fee_payments), so I added this same action + view file to my controller and I changed this in pay_all_fees.html.erb:

<%= link_to "► #{t('print_receipt')}",

                  {:controller => "finance_extensions", :action => "pay_all_fees_receipt_pdf", :id => student.id}, :target => '_blank', :class => 'user_button' %>

to this:

  <%= link_to "► #{t('print_receipt')}",

                      {:controller => "parent_wise_fee_payments", :action => "pay_all_fees_receipt_pdf", :id => student.id}, :target => '_blank', :class => 'user_button' %>

This causes the button to disapper. I also tried adding a test action and view in my controller, and tried removing " :controller" but it didn't solve my problem.

Is this weird or am I missing something here?!


Solution

  • Did you add your new action to the auth file in the config??