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 8298209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:41:13+00:00 2026-06-08T15:41:13+00:00

I’m trying to create a form where a user can type in their email

  • 0

I’m trying to create a form where a user can type in their email and it will save it to the db. I want this form in the footer of every page.

I’ve generated NewsletterSignup via rails scaffolding.

Now i have this code in my /app/views/refinery/_footer.html.erb:

<%= form_for(@newsletter_signup) do |f| %>
  <div class="field">
    <%= f.label :email %><br />
    <%= f.text_field :email %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>

and when i try and load the page i get this error:

 NoMethodError in Refinery/pages#home

Showing /Users/tomcaflisch/Sites/PersonalTrainingKT/app/views/refinery/_form.html.erb where line #1 raised:

undefined method `newsletter_signups_path' for #<#<Class:0x007fb84c769ba0>:0x007fb84c08d110>

Why is the method undefined? If i run rake routes i can see it exists:

newsletter_signups GET    /newsletter_signups(.:format)          newsletter_signups#index
                       POST   /newsletter_signups(.:format)          newsletter_signups#create
 new_newsletter_signup GET    /newsletter_signups/new(.:format)      newsletter_signups#new
edit_newsletter_signup GET    /newsletter_signups/:id/edit(.:format) newsletter_signups#edit
     newsletter_signup GET    /newsletter_signups/:id(.:format)      newsletter_signups#show
                       PUT    /newsletter_signups/:id(.:format)      newsletter_signups#update
                       DELETE /newsletter_signups/:id(.:format)      newsletter_signups#destroy

routes.rb

PersonalTrainingKT::Application.routes.draw do

  resources :newsletter_signups

  # This line mounts Refinery's routes at the root of your application.
  # This means, any requests to the root URL of your application will go to Refinery::PagesController#home.
  # If you would like to change where this extension is mounted, simply change the :at option to something different.
  #
  # We ask that you don't use the :as option here, as Refinery relies on it being the default of "refinery"
  mount Refinery::Core::Engine, :at => '/'
end

I’m also creating a new object in the application_controller since this newsletter signup will be available on every page:

class ApplicationController < ActionController::Base
  protect_from_forgery

  before_filter :instantiate_newsletter_signup

  def instantiate_newsletter_signup
    @newsletter_signup = NewsletterSignup.new
  end
end
  • 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-08T15:41:15+00:00Added an answer on June 8, 2026 at 3:41 pm

    It looks like since refinerycms mounts the routes (not sure if that’s correct terminology), it cannot see normal routes.

    From this link https://groups.google.com/forum/#!topic/refinery-cms/5k7Co4D1bVI I figured out that i needed to change

    <%= form_for(@newsletter_signup, :url => newsletter_signups_path, :method => :post) do |f| %>
    

    to

    <%= form_for(@newsletter_signup, :url => main_app.newsletter_signups_path, :method => :post) do |f| %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.