Forum: Ruby on Rails Just a couple questions on how I should go about this.

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Matt R. (Guest)
on 2006-04-24 03:40
(Received via mailing list)
I'm working on my personal site. The design is complete and I want to
integrate some rails into it. I've done a few small things before, but
compared to them this is big.

I need a simple blog with categories and comments and an archive. I want
nice posting system, but don't want it in HTML. Is there something I can
or make, kind of like BBCODE?

I pretty much know what else I have to do, but there is one more thing.
client section. I want clients to be able to login and view things I've
submitted and be able to comment back. A rudimentery forum. If there
were a I'd want to be able to say only THIS
and THAT user can look at /zigzag and comment/add things. Any idea how I
should go about it?

I'm not looking for exact code, but just something to help me get
I'm still fairly new to rails, but I think this will be a nice project
get me up to speed.

David M. (Guest)
on 2006-04-24 03:52
(Received via mailing list)
It sounds like you should investigate one of the role-based
authentication solutions for Rails.  I've used ActiveRBAC in the past,
and it's worked well; however, there are others, or you can roll your
own fairly easily.

The basic idea is that you give one or more roles to all of your users
(e.g. "editor", "commenter", "admin", ...), and they you assign
permissions to do specific things (e.g. add a comment, restart the
system, add a topic, erase a comment) to those roles.  It's a lot
easier doing things that way than trying to manage things on a
person-by-person basis.


Dave M.
Matt R. (Guest)
on 2006-04-24 04:07
(Received via mailing list)
I think I need to do it by person, or else people would have access to
project and could comment them, and that's not what I want. I want it to
a place where we (client and myself) can talk privately about what's
on and keep up to date.

Also, is there an easy way to email when something new is commented on
the client section? I'd also like the ability to send out a text message
myself or the client when things are updated. Is that possible?

Thanks a lot :)
David M. (Guest)
on 2006-04-24 04:22
(Received via mailing list)
Consider using RSS instead of email as a simple way of notifying your
users when an update is performed.  It's very simple to implement, and
well covered in the "Rails Recipes" book if you need a reference.

If RSS isn't an option, then you can used the created_at and
updated_at fields in your tables as a reference point.  If you create
these fields in each of your tables as date/time fields, then Rails
will automatically populate them for you when data changes in those

Using this, you could create a cron job to walk through your database
every e.g. 5 minutes, select any records with the updated_at field < 5
minutes old, and send out appropriate email messages.  Not particuarly
difficult to set up, but a fair bit more painful to test and monitor
once it's in production.

As far as role-based authentication goes, there's nothing stopping you
building a system whereby a user could be an "editor" for project A,
and a "read-only" for project B.  You'd probablyh have to create a
3-way join table defined like this:
- id (primary key)
- user_id (reference into your users table)
- role_id (reference into your roles table)
- project_id (reference into your projects table)
and use it to track the user<->role<->project linkage, but that isn't
a difficult thing to implement.

I would still look at employing a role-based model for this if at all
possible - unless your site is extremely small, I think maintaining an
individual-based access model will be too painful in the long term.


Dave M.
This topic is locked and can not be replied to.