I18n and monologue

39 views
Skip to first unread message

thomasbe...@gmail.com

unread,
Jun 19, 2013, 6:11:12 AM6/19/13
to monolo...@googlegroups.com, ragulan...@arizuka.com
Hello,

I'm trying to install monologue on a web application and I'm facing a problem that I'm not sure about how to solve it.

Here's my problem :

My Rails Application is using I18n, in order to manage few languages.
I added monologue to the Gemfile, installed monologue, created a user ...

The problem is coming when I log myself to get to the admin panel.
When I submit the form, I've got "undefined method `locale' for #<Monologue::User:0xd4d9510>".
So basically if I understand it well, Monologue does not recognize the locale variable indicating the current language.

My route for Monologue is :
mount Monologue::Engine, :at => '/blog'

In order to access the panel admin I actually go to :
localhost/blog/monologue
With this route, the problem exist because there's no locale.

When I get to :
localhost/fr/blog/monologue
There's no more error cause the locale is set as 'fr'.

I check db/migrate to see if Monologue where actually creating an other User table but apparently it does not.

Yet in my application I have a locale column on my User table, so I don't understand why Monologue's saying to me that locale is a undefined method.

Can you please help me ?

Cordially,
Thomas.

Jean-Philippe Boily

unread,
Jun 19, 2013, 7:32:10 AM6/19/13
to thomasbe...@gmail.com, monolo...@googlegroups.com, ragulan...@arizuka.com
Hi,
  actually, Monologue has it's own user's table: https://github.com/jipiboily/monologue/blob/master/spec/dummy/db/schema.rb#L53.

Migrations in db/migrate are not really useful as it is an engine and uses those in spec/dummy/db/migrate. I will remove them. Sorry for the confusion!

Hope that helps.

Best,

Jean-Philippe Boily

--
You received this message because you are subscribed to the Google Groups "Monologue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to monologue-rb...@googlegroups.com.

thomasbe...@gmail.com

unread,
Jun 19, 2013, 7:55:23 AM6/19/13
to monolo...@googlegroups.com, thomasbe...@gmail.com, ragulan...@arizuka.com, Fabrice Carrega
Thanks for your answer, it was really fast.

However I've got one more question.

Is it possible to take my User table to use it in Monologue ?

Cordially,

Thomas

Jean-Philippe Boily

unread,
Jun 19, 2013, 8:06:24 AM6/19/13
to thomasbe...@gmail.com, monolo...@googlegroups.com, ragulan...@arizuka.com, Fabrice Carrega
I guess that would be possible, but I don't have the details right now…at least, I am not 100% sure. You could try monkey patching with something like that: https://gist.github.com/jipiboily/776d907fc932640ac59a.

Didn't try it, but it should work, or get you enough information to google that. 

That said, beware, migrations from Monologue on user's table would now be run over your own table, so watch out when something changes on that, if it happens with newer versions! :)

Regards,

Jean-Philippe Boily

thomasbe...@gmail.com

unread,
Jun 19, 2013, 8:20:42 AM6/19/13
to monolo...@googlegroups.com, thomasbe...@gmail.com, ragulan...@arizuka.com
Ok I'll try it.

I'll let you know if it works !

Best regards,

Thomas

thomasbe...@gmail.com

unread,
Jun 19, 2013, 10:20:23 AM6/19/13
to monolo...@googlegroups.com, thomasbe...@gmail.com
I tried your gist a bit everywhere because i wasn't sure where to do it.
But it hasn't work :/
I gave up and decided to use the actual monologue User db.

It's all working except for one thing.

When I try to post a new monologue with content in all the inputs (TinyMCE for the content) I actually got a message error saying that content is required (I swear content was in it ^^ ).

Can you help me with this error ?

Cordially,
Thomas

Jean-Philippe Boily

unread,
Jun 19, 2013, 11:05:20 AM6/19/13
to thomasbe...@gmail.com, monolo...@googlegroups.com
Hum, I have no idea right off the of my head, please post an issue for that on GitHub and I or someone else will take care of it: https://github.com/jipiboily/monologue/issues/new.

Please include steps to reproduce. :)

Cheers,

Jean-Philippe Boily

thomasbe...@gmail.com

unread,
Jun 19, 2013, 12:53:28 PM6/19/13
to monolo...@googlegroups.com, thomasbe...@gmail.com
I just found the solution for my problem, few people might encounter the same problem.

The point was that I worked with compiled assets.
TinyMCE is used in monologue but it wasn't (correctly) compiled.
I just added the gem "tinymce-rails" and bundle update.

Everything after that worked and still work atm ^^.

Thanks for the attention this afternoon.

Best regards o7,
Thomas

Reply all
Reply to author
Forward
0 new messages