Hi, i'm trying to write a simple extension to store emails, that users can
entry thru the newsletter form in one of the default templates.
So i changed the snippet newsletter to something like that:
<div class="box"> <h3>Our Newsletter</h3> <form action="/newsletter/send"
method="get"> <input class="email" value="Enter your email address..."
type="text" id="email" name="name" /> <input class="subscribe" type="submit"
value="Subscribe" /> </form> </div>

my route at my extension.rb is something like:

define_routes do |map|
    map.connect '/newsletter/send',
:controller=>'newsletter',:action=>'send'
end

As a test i tried to call my controller/action like that:

http://localhost:3000/newsletter/[email protected]

It didnt work, my controller is like that:

class NewsletterController < ApplicationController no_login_required
#skip_before_filter :verify_authenticity_token def send #...@news =
Newsletter.find_or_create_by_email(params[:email]) @news =
Newsletter.new(params[:email]) @news.save flash[:notice] = "Your e-mail was
added to our newsletter" redirect_back_or_default("/") end end

Questions:
1) I cannot use a normal form syntax in my html?
2) I cannot access the params at my controller?

Thanks!
_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to