I'm using Mongoid as a storage and ActiveAdmin as an admin backend in my Rails project. And I need to support a couple of languages.
Native Rails i18n works perfectly for static texts. But I need also translate db content. I've found that mongoid natively support localized fields: http://mongoid.org/en/mongoid/docs/documents.html#localized_fields .
Is there any good way to use ActiveAdmin and this cool feature together?
I just met the same problem and decided to make a gem for this:
https://github.com/rs-pro/activeadmin-mongoid-localize
Related
I want to customize rails scaffolding. For that I want to set up a custom template engine.
Can anyone guide me to set a custom template-engine.
You don't need a custom template engine to customize rails scaffolding. Depending on what you're trying to do, you can customize your rails generators or use a tool such as rails-composer / rails_apps_composer.
If you're looking to switch the default template engine, for rails 3, you can use --template-engine flag. There are also options such as Tilt that provide a layer of abstraction so that it's easier to switch between the leading options.
I am looking for a template generator for rails, much like the scaffolding, but complete with preset pages and css, everything already built-in generically.
I am unsure where or how to search for this.
The reason I want something like that and not create one myself, is that I need to create a website really quickly with a certain preset theme
I had the same problem that you had, and could not find a solution. Therefore I built a gem for it.
https://github.com/bighostkim/simple-layout
It only applies to your development mode and it does not use asset to make it simple.
Hope it helps.
Rails Yard may be the solution you are looking for. It is a CMS written in Rails.
Rails CMS WIKI FORUM 2nd option
Rails Admin is great for data management (Create, Retrieve, Update, Delete).
I'm looking for a way to modify the values of I18n yml files for locales via web gui, is there some gem for that?
A gem that mimics Twitter Translation Center github.com/badrit/translation_center
Tolk is a web interface for doing i18n translations packaged as an engine for Rails 4 applications
https://github.com/tolk/tolk
Yes, I modified the Newsdesk's translate plugin for using with Rails 3:
https://github.com/romanbsd/translate
There's also tolk written by the creator of rails:
https://github.com/dhh/tolk
In http://rst-it.com we also had problems with finding the right solution, so we decided to make an activeadmin translation panel with interface similar to http://www.localeapp.com/.
Currently we are in design stage (first draft is on https://github.com/KMPgroup/active_I18n) but next week we will have working solution.
I will post here info when we lunch it, but in the meantime you can check https://github.com/KMPgroup/active_I18n and tell us what you think or even write an issue - the more feedback at the beginning the better.
This looks promising too:
http://www.localeapp.com/
I think I will give it a try. Anyone has experience with this service?
I've been searching for an equivalent to Symfony's built-in Localized Schema which provides a native support for managing internationalized Tables/DB. Here is a link to Symfony's documentation covering their implementation of I18n & L10n, with the relevant part on Localized Schema (appx. a third down the page, such as the paragraph "Text Information in the Database").
I've checked out Globalize2 gem, but not sure as to whether it is fully supported in Rails3.
Also found the gem puret, which seems to have more recent commits/activity.
All in all though, it's very likely I am missing out on other possible options, as still getting my bearings in RoR dev.
Open to any info/suggestions you may have! ;)
Try gem named has_translations. It have been tested in several production sites for a one year already. Supports 1.9 + Rails 3. For any issues fill out form on the github.
https://github.com/dmitry/has_translations
Actually it's more or less the same as puret, but it was built when rails 2.3.5 was a mainstream, so I just supported it for a websites I've did already. I suggest you to choose between puret and has_translations, others is too magic or not maintained anymore. You can find more alternatives in has_translations README file.
I'd like to see an example of an application generator template for Rails 3. Any suggestions?
I'm interested in an example of a template that is used to generate a new Rails application. Ryan Bates has a screencast (#148 App Templates in Rails 2.3) that describes how to create an application generator template for Rails 2.3 but I'd like to see how something similar is implemented in Rails 3. I've seen several tutorials on using the Rails 3 generators but I haven't found anything that shows how to create an application generator template.
I presume all of the capabilities of Thor and Rails::Generators::Actions are available but I'd like to see how to use them in an application generator template.
It seems terminology is confusing here. "View Template Engines" (such as Haml) are one thing; "Rails Generators" (such as used for "rails generate helper") are another thing; and "Application Generator Templates" (used for "rails new app_name -m some/path/to/template") are quite another thing.
Dug around in the Rails source and answered this question myself :-)
Here's an example of an application generator template for Rails 3:
http://github.com/fortuity/rails3-mongoid-devise/raw/master/template.rb
Usage:
rails new app_name -m http://github.com/fortuity/rails3-mongoid-devise/raw/master/template.rb
In customizing this template, you can use any methods provided by Thor::Actions
http://rdoc.info/rdoc/wycats/thor/blob/f939a3e8a854616784cac1dcff04ef4f3ee5f7ff/Thor/Actions.html
and Rails::Generators::Actions
http://github.com/rails/rails/blob/master/railties/lib/rails/generators/actions.rb