Это мой код
из index.html.erb
<%= form_for index_path, :method => "POST" do %>
<%= label_tag :name, "Enter your full name: " %>
<%= text_field_tag :name, @name, :placeholder => "Enter your name" %><br/>
<%= label_tag :email, "Enter your e-mail address: " %>
<%= email_field_tag :email, @email, :placeholder => "something@domain.com" %><br/>
<%= label_tag :question, "Type your question: " %>
<%= text_area_tag :question, @question, :size => "30x5", :placeholder => "Your text goes here", :maxlength => "130" %><br/>
<%= submit_tag "Ask Question" %>
из Blog Controller
class BlogController < ApplicationController
def index
@name = params['name']
@email = params['email']
@question = params['question']
end
def about
end
def contact
end
end
А из семян.рб:
Invitation.create(:name => "#{@name}", :email => "#{@email}", :question => "#{@question}")
Когда я заполняю все поля и отправляю, в базе данных создается пустая запись, что я делаю не так?