Just a couple questions on how I should go about this


#1

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
a
nice posting system, but don’t want it in HTML. Is there something I can
add
or make, kind of like BBCODE?

I pretty much know what else I have to do, but there is one more thing.
A
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
http://clients.whatever.com/zigzag I’d want to be able to say only THIS
user
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
started.
I’m still fairly new to rails, but I think this will be a nice project
to
get me up to speed.

Cheers


#2

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.

Regards

Dave M.


#3

I think I need to do it by person, or else people would have access to
any
project and could comment them, and that’s not what I want. I want it to
be
a place where we (client and myself) can talk privately about what’s
going
on and keep up to date.

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

Thanks a lot :slight_smile:


#4

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
records.

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.

Regards

Dave M.