Displaying 1 result from an estimated 1 matches for "servicecontact".
2013 Jun 23
1
Contact form - NoMethodError (undefined method `each' for nil:NilClass)
...ass ScontactController < ApplicationController
def new
@message = Servicemail.new
@szolg = Service.find_by_permalink!(params[:id])
end
def create
@message = Servicemail.new(params[:message])
@szolg = Service.find_by_permalink(params[:id])
if @message.valid?
ServiceContact.new_message(@message).deliver
redirect_to(szolg_path(@szolg), :notice => "Message sent
successfully!")
else
flash.now.alert = "Please fill out all the required fields!"
render :new
end
end
end
Is it the name of the model/view/controller that bo...