I’ve been following the development of a few Rails CMS/blog engines
and so far I really like Radiant but I can’t quite figure out the best
strategy to implement dynamic pages like contact/registration forms.
Maybe I’m missing the obvious but how would you go about generating a
registration form (with validation errors, thank you message and all):
Generate a clean registration object and save it into the session.
Create tags that pull the registration info from the session.
Process the post in a controller outside Radiant and return
processed data to the session.
Is that how you would do it? Or do I need another pure Rails site
(forms.domain.com) to process dynamic data?
Sorry but I’m confused. Most of the site I would use Radiant for are
mostly content but always have one or two forms that are always
around. I would really apreciate your ideas on getting the best of
both worlds.
This seems to be a case where you would create a custom behavior that
generates the form, then a controller it can post to. Of course, you
would
have to change the routes file as well to handle the special controller.
Radiant is designed with the content as the core and it does that very
well. Good luck finding what you need!
I think that creating a form on a page and giving that page a custom
form behavior is probably good enough. You can use the behavior to
handle the form posting. Look at how the FormMailer behavior works.
Thanks to everybody for the ideas and pointers. since I found a way to
do a
simple registration form I thought I should report on my findings. I
have
attached the behavior just in case it can help anybody out there. It is
heavily modeled after (read ripped from) the Mailer behavior. BTW, the
Mailer ehavior has some nice general form creation tags although I
wonder
if/how to use the builtin Rails helpers for that. Anyway, here’s how I
use
it:
The only real problem I faced was that I could not get the behavior to
respect process() (it would not run by any means). So I moved to using a
before filter to process the POST but I still cannot redirect after
processing. I’m sure I am missing something but the original Mailer
bahavior
would not send emails either or bark about it. BTW, I’m running this on
0.5.2 unpacked. For me redirecting sometimes is a requirement so if
anybody
has any ideas on why it is not working please let me know.
Hi all,
I want a page where the content can be find from a search page.
root
→ agenda
→ contact1
→ contact2
In agenda a want find the contact by city, name, etc.
I think tha cantac page like this:
<r:my_tag_name>name 1</r:my_tag_name>
<r:my_tag_city>name 1</r:my_tag_city>
So, out of my problem, an idea can be build a Behaviour for add CRUD
page
(new table in the db) and admin’s page for the public face of radiant.
So we can have:
a Public section
an Admin (developer) section
a admin (site) section
I think radiant is already fantastic.
With this behavior maybe can be a paradise’s app
Any comment?
I’am a newbie and it’s always only an idea (at the moment).
whichever thing happens compliments at all for tha moment.
Lucio
With this behavior maybe can be a paradise’s app
Any comment?
Lucio, I’m having trouble understanding your question. Are you wondering
if it is possible to add fields to the Page class? If so the answer is
yes, you can do it with the Rails plugin system, but it may be
difficult. The plugin system doesn’t make it easy to modify models or
views, but it can be done.
With this behavior maybe can be a paradise’s app
Any comment?
Lucio, I’m having trouble understanding your question. Are you wondering
if it is possible to add fields to the Page class? If so the answer is
yes, you can do it with the Rails plugin system, but it may be
difficult. The plugin system doesn’t make it easy to modify models or
views, but it can be done.
my problem is not insert the search’s field
but, if possible, select the values in my tags
<r:my_tag>value to select by search</r:my_tag>
So you want to be able to define custom strings inside of page parts
that will be indexed by the search engine? That would be quite
complicated, I’m not sure what to recommend.
The only real problem I faced was that I could not get the behavior to
respect process() (it would not run by any means). So I moved to using a
before filter to process the POST but I still cannot redirect after
processing. I’m sure I am missing something but the original Mailer bahavior
would not send emails either or bark about it. BTW, I’m running this on
0.5.2 unpacked. For me redirecting sometimes is a requirement so if anybody
has any ideas on why it is not working please let me know.
I have run in to the same issue (Mailer not sending mail, or not
redirecting to thank you page). I have stopped using it for now (until
I have time to take care of that - I want to also build feedback into
my 404 page, so people can tell me about broken links with just a
click or so.).
I had trouble too with getting filters to run. In the end,
process(request, response) did the trick, whereas the other’s just
refused to do anything. I wonder why.
How do people debug the behaviors, especially when it is running as a
plugin? I didn’t find a logger object to use within the behavior
(maybe there is one, who knows?), Doing print statements only works
inside the test runs, and not under tail -f development.log, or even
the Webrick screen. I had some serious time burnt due to this, until I
resorted to using ./script/breakpointer. Sometimes too, you get an
error message trapped nicely for you by Radiant and you just want to
know what line caused it, but it’s not so easy as it could be.
What’s the secret sauce? And does Mailer work for everyone, except maybe
me?
On 8/16/06, Adrian M. [email protected] wrote:
How do people debug the behaviors, especially when it is running as a
plugin? I didn’t find a logger object to use within the behavior
(maybe there is one, who knows?), Doing print statements only works
inside the test runs, and not under tail -f development.log, or even
the Webrick screen. I had some serious time burnt due to this, until I
resorted to using ./script/breakpointer. Sometimes too, you get an
error message trapped nicely for you by Radiant and you just want to
know what line caused it, but it’s not so easy as it could be.
You can do something like:
def logger
ActiveRecord::Base.logger
end
in your behaviour to get access to a logger while testing…
What’s the secret sauce? And does Mailer work for everyone, except
maybe me?
It was working for me, but I had hacked it up to do some other things
(like store inquiries in the database).
I dont have a lot of time to look into it right now though
Has anyone gotten the Mailer Behavior to work on dreamhost? I am
trying to get an app up and running there and it is important that
the forms work. Right now, I just have a “protected method
`get_class_name’ called for #” error. I am on a pretty tight schedule
so any help would be appreciated…
Has anyone gotten the Mailer Behavior to work on dreamhost? I am trying
to get an app up and running there and it is important that the forms
work. Right now, I just have a “protected method `get_class_name’ called
for #” error. I am on a pretty tight schedule so any help would be
appreciated…
If you need something fast on the forms end you might try wufoo:
It is not working for me too. I attempted to push for a mailer
behavior fix in several posts on this list but nothing yet, so far …
Unfortunately I’m not in the condition to attempt a fix by myself
at the time being.
It is not working for me too. I attempted to push for a mailer
behavior fix in several posts on this list but nothing yet, so far …
Unfortunately I’m not in the condition to attempt a fix by myself
at the time being.
Just working on something else and i noticed in line 19 of config/
environment.rb has:
and see if that fixes it. Also, i think it says on the wiki that the
mailer behaviour needs the Radiant behavior filters plugin, but i
vaguely remember that if you actually install the plugin, it breaks
the mailer behaviour!