When creating a mountable Rails 3.1 engine using
rails plugin new my_engine --mountable
it creates the engine at MyEngine::Engine < Rails::Engine
Is there a way to generate it like the jQuery::Rails engine (Jquery::Rails::Engine), or do I have to do it manually?
I tried these, and of course it didn't work.
rails plugin new "my_module/my_engine" --mountable
rails plugin new "my_module::my_engine" --mountable
I took a peek in the rails source, and you won't like the answer. Plugin generation seems to make the assumption that your engine name isn't nested, like here.
If you really insist on not doing this by hand, you could try to hack your way through the generator or use a PluginBuilder with the -b option of the rails plugin new command. It doesn't look documented though, a quick search on Google didn't reveal any info, but I may have overlooked something.
Hope this helps.
Related
I use gem install radiant to install radiant, and I found that it doesn't support Rails 3. But, I found there is a file named "GemfileRails3" in the source code of Radiant on Github, I wonder why is that. Does Radiant really not support Rails3?
Radiant still does not support Rails 3 at this moment. A lot of work towards that has been done, but the project is lacking momentum, making it hard to say when this can be released.
I'm going to develop an application on Ruby on Rails which has many library classes. But I have no such idea. Is it possible or not in Rails? If possible, how can I develop my own library class in rails application? Please suggest me.
since i do not understand your question very well, i can only guess what you mean.
there are several ways of abstracting logic in ruby and ruby on rails.
the most general approach is creating ruby gems. this is a package of ruby code that can be used in every ruby project. it's possible to hook into rails through gems via railties.
there are two things that are specific to rails. the first one are plugins, that work very similar to gems and are considered a legacy way of providing functionality, but there are still some plugins around, especially for rails apps prior version 3.
the other thing is engines. these are micro-applications that can be mounted into any rails app. they are self-contained and can provide a lot of functionality based on their namespaced routes.
since rails is based on rack, it's also possible to hook any rack-conform ruby application into the rails router. through this approach it's possible to connect rails apps with ie. sinatra applications.
I've been reading a lot of info on Require.js. AMD seems very interesting and I got it to work in a standalone backbone.js app. However, Sprocket in Rails seems to conflict with it. Do you recommend projects to go with standard Rails asset pipeline without Require.js?
I saw this article but it's for Rails 3.1, so not sure if it's still applicable: Using RequireJS with a Rails 3.1 app
Also, Underscore no longer seems to be supporting AMD. I don't want to use yet another package to work with Backbone.
I did this awhile ago I used the "use" requireJS plugin to load incompatible libs like underscore.js
https://github.com/tbranyen/use.js
and I think I only included require.js into the sprockets assets, and used it like in any other application.
I'm working on a small project that has been allocated a small amount of time to maintain and update features. This project is on Rails 2.3.
I'd like to move it to Rails 3.2 but there is little time allocated to this so I would like to do it over a slow gradual process.
I'm thinking that it might be worth moving over to Rails 3.2 on a section-by-section basis.
This would mean that I would create a second application that looks the same as the first one but is located somewhere different and accessed from a different subdomain.
Is this feasible if I just update the Rails 2.3 routes file for certain routes to go to the new application?
Has anyone done this before?
It depends on many parameters but among these the most relevant are :
Does your Rails 2 project already use Bundler ? If not, migrate to it before the migration.
Do you use gems which are known not to work on Rails 3 ?
Does your project already use Rails XSS plugin (https://github.com/rails/rails_xss) ? If not, migrate to it before the migration.
After that, the migration will be easier.
For the migration, I recommend that you create a brand new Rails application using "rails new" command, so that all the boot files will be good. Then migrate the initializers/config files and "app" folder...
Good luck.
I've been trying to add a basic CMS to my new Spree 0.40.x but I'm no getting any success. Documentation seems bare empty.
I've tried every extension listed here but I couldn't install some of them, others I did installed them, but seems they're using rails 2 deprecated methods.
Does any of you have been able to add a CMS to Spree under Rails 3? I don't mind if i need to use an older version of Spree, I just need a basic CMS.
Thank you
Why exactly will you need CMS?
If you require it to create static pages with WYSWYG editor then you can use spree-static-content extension https://github.com/spree/spree_static_content