Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7780163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:49:28+00:00 2026-06-01T18:49:28+00:00

I’m getting this error when trying to use form_for: _feedback_form.html.erb: <%= form_for @support, :html

  • 0

I’m getting this error when trying to use form_for:

_feedback_form.html.erb:

<%= form_for @support, :html => { :method => :post } do |f| %>
    <%= f.text_area :content, :class => "quick_feedback_form", :input_html => { :maxlength => 450 } %>
    <%= f.hidden_field :email, :value => current_user.email %>
    <div><%= f.submit "Send!", :disable_with => "Sending...", :class => "button white" %></div>
<% end %>

Running this returns this error:

NoMethodError in Pages#guardian

Showing /home/alex/myapp/app/views/supports/_feedback_form.html.erb where line #1 raised:

undefined method `join' for nil:NilClass

The @support variable is created and is not nil – I can see it from the log. This was also working nicely in Rails 3.0, and now after migrating to Rails 3.2 this is somehow broken.

Here is a class of Support variable. This is used for sending email feedback to the admin:

class Support < ActiveRecord::Base
include ActiveModel::Validations

  validates_presence_of :content 
  # to deal with form, you must have an id attribute
  attr_accessor :id, :email, :sender_name, :content

  def initialize(attributes = {})
    attributes.each do |key, value|
      self.send("#{key}=", value)
    end
    @attributes = attributes
  end

  def read_attribute_for_validation(key)
    @attributes[key]
  end

  def to_key
  end

  def save
    if self.valid?
      Feedback.support_notification(self).deliver
      return true
    end
    return false
  end
end

Tried different things but still can’t see what is wrong here. Rails 3.2.1.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T18:49:29+00:00Added an answer on June 1, 2026 at 6:49 pm

    I think the problem is your to_key method. Is there a reason you’re defining this method here? It’s already defined in ActiveRecord::Base, so you’re overriding the internal method. If you just take it out of your model, that should fix your problem.

    If you do want to define to_key here for some reason, remember that for persisted models (e.g. ActiveRecord models), it should return an array with the key attributes of the model. So it should look something like this:

    def to_key
      [self.id]
    end
    

    And why are you including ActiveModel::Validations? This is done for you in ActiveRecord::Base.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.