Displaying 2 results from an estimated 2 matches for "find_by_permalink".
2013 Jun 23
1
Contact form - NoMethodError (undefined method `each' for nil:NilClass)
...f initialize(attributes = {})
attributes.each do |name, value|
send("#{name}=", value)
end
end
def persisted?
false
end
end
This is the controller:
class 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!...
2006 Mar 13
5
Displaying related entries by tags - HELP!
Ok, my site is setup like pretty much every other blog out there. A
list of the most recent 5 posts, then by clicking one, you go to an
individual post page, displaying the full context of that post.
Now, what I would like to do is to display the related entries in the
side column, which is part of the layout, based on the tags belonging to
that specific entry.
Here''s my coding so