Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails - what does - multiple values for a block parameter (0 for 1) - mean?

I keep getting this error on Heroku but not locally. any idea why that would be?

/disk1/home/slugs/352624_0e85669_cd2f-9e7b2ba0-45de-479f-b275-af88d0b560c6/mnt/app/views/sessions/_new.html.erb:2: warning: multiple values for a block parameter (0 for 1)

from /home/slugs/352624_0e85669_cd2f-9e7b2ba0-45de-479f-b275-af88d0b560c6/mnt/.bundle/gems/ruby/1.8/gems/actionpack-3.0.0/lib/action_view/helpers/capture_helper.rb:39

Here's some of the template:

<div id="account-signin">
 <%= form_tag(new_user_session_path, :method=>'post', :id => 'user_signin') do |f| %>
  <table>
   <tr>
    <td>
     <table>
      <tr>
       <td>
        <%= label_tag 'Email' %>
       </td>
       <td>
        <%= label_tag 'Password' %>
       </td>
like image 961
AnApprentice Avatar asked Nov 27 '22 22:11

AnApprentice


1 Answers

The block given to the form_tag method doesn't take any parameters. The error is telling you that your block requires an argument, but form_tag doesn't have any arguments to give it. Remove the "|f|" bit at the end of the form_tag line and it should work.

like image 52
Brandon Yarbrough Avatar answered Dec 19 '22 10:12

Brandon Yarbrough