-
Notifications
You must be signed in to change notification settings - Fork 461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rough howto #16
Comments
Hi Wolfgang! You need to run the install, migrate and modifiy a bit the initializer. You only need your "messageable" model, the one you want to be able to send and receive messages. Adding "act_as_messageale" is all you need. I have improved the documentation in the README, https://github.com/ging/mailboxer/blob/master/README.textile. Please take a look at it and see if it helps you. If there is any problem, missunderstanding or something you miss, let me know to improve it before releasing a new version. Good luck! |
I feel I am too much a newbe, I would want to integrate this now in the rails UI, I assume my steps would need to be then: alfa.send_message(beta, "Body", "subject") create views to send message, thus have a message controller thus have a message model? Adding this send message to my user object restful ressources sounds not so great or can I inherit something from that? might it be a nester route of my model already? On Jan 18, 2012, at 10:12 PM, Eduardo Casanova wrote:
|
Hi Wolfgang! What mailboxer adds to you is a core for sending messages. Just by adding "act_as_messageable" to your User (or Whatever) model you get a lot of new methods added to it. For a full API you should refer to rubydoc. This core includes several models: Message, Conversation (a wrapper of messages), Receipt (relation model between the messageable and the message), Notification (related to notification system, not messaging system), Mailbox (managing the conversations, messages and receipt of a messageable) and Messageable (modeling the new methods added to your model "acting as messageable". Those models already exist just by requiring mailboxer in your app, you don't need to have any message model. As you have infered, what you need to create are controllers and views. I can't give you a more detailed documentation because each situation and application is different, but I can show you and example. Mailboxer was created as a part of SocialStream, a core to build social networks. As mailboxer is already integrated there, is a good start point to you. If you have serious problems understanding what goes now, please consider following some tutorials regarding rails 3.1, gems and engines, wich will surely be helpful. The best way to do it ruby-like and restful is to create two controllers: To add your routes in config/routes.rb (example): Rails.application.routes.draw do
#...
resources :messages
resources :conversations
#...
end Your Please, notice that there are parts of the code not related with mailboxer, as the line before_filter :authenticate_user! related to the authentication protocol of SocialStream. The views are heavily dependant on your application, so this will be the part you should work the most. The example of Conversations views are here and the ones for Messages are here. Please, take into account there are also javascript dependencies (in I hope that helps you. If so, let me know to add this short tutorial to the wiki or a more visible place than an issue. Good luck. |
Hi @wolfgangihloff! Are you still interested in this issue? |
I just took a look and the info was definitely helpful - thanks for posting it. I'd suggest adding it to a wiki or linking to it in the README so that it's more visible. Looking forward to building this into my app - thanks for all of your work. |
Thanks to you @kcurtin! Working on it right now :) |
So I installed this gem and I know you are busy with other stuff, but maybe you can give me a 5 step simple howto, I seem to need to have a message model or something setup besides running the setup. I can deliver email or not?
A little bit more documentation is needed, I would then surely provide my project as a sample.
It just needs for me user, messages but even that simple documentation I cannot find.
The text was updated successfully, but these errors were encountered: