I am using sfAdminJrollerTheme Plugin for some parts of my application, but when I generate new modules without admin generator, I lose same look and feel than jroller in my other application pages. I know maybe is good idea to use admin generator for everything but I cannot change all my modules.
Regards,
If you do not use the admin generator then you have to create your own look and feel using HTML and CSS.
Have a look at the generated files that exist in the cache folder to see the PHP that the admin generator generates.
The admin generator is excellent for making simple modules for manging data. Plus they can be built very quickly, but I would not advise using them for everything.
Creating a basic module and developing your own custom functionality is much more powerful.
Related
When I start a new Rails application, I often use certain parameters to rails new like --skip-spring or --skip-turbolinks.
I understand I can put these in ~/.railsrc, but when using multiple dev computers, it can be a bit tedious to keep railsrc files in sync across all of them.
Can I use application templates to add these parameters to the generator? That would be great, because application templates can be referenced by a url and downloaded on the fly.
(Also I know I can use templates to make changes after the application is created, so I can remove spring or turbolinks or whatever, but it would be much nicer to never generate the app that way.)
To answer my own question after looking into how this works, I think the short answer is that it's not possible to add generator parameters from an application template to rails new itself. The reason is that the template code only runs when the application is already generated.
I have created an admin interface as a Rails engine. In the project I work in at the moment I need to add some custom javascript. I want to keep this in my main app and not add it in my engine.
Perhaps register some javascript or stylesheet files in a config file and let the engine include them.
Any ideas on how I can achieve this?
you are asking about ideas, so here is one: just use a convention!
it's common to do this in rails, so why not just do it for your engine. just document how to name the files and what to configure for that (assets need to be configured differently when they should not be included in application.js/css). the admin interface typus does the same thing: http://docs.typuscmf.com/customization/custom_css_and_js.html
in your engine, you can just check if that file is present in the mounting app and include it in that case.
should be pretty straight forward.
I have a rails app that allows users to create their own website easily but they share the same page structure.
I plan to switch my classic rails views for a templating language such as liquid or handlebars.
The goal is that my users could upload their own version of templates and css to completely customize the look and feel of their website.
Example of workflow :
User upload a theme folder containing Templates and Css files
Their website automatically uses this new templates and designs
Is it possible to do that and continue to take advantages of the Rails Assets pipeline?
Thanks a lot for your answers !
This might be something you can try: http://www.krautcomputing.com/blog/2012/03/27/how-to-compile-custom-sass-stylesheets-dynamically-during-runtime/.
I've used this in a Rails 3.2x project and it works fine, but I'm having difficulties getting it working in a different (somewhat modified Rails 4 project).
It's older article about compiling css on the fly using the Sprockets::StaticCompiler class.
I have been doing UI research and have come across admin templates at http://themeforest.net/. I was wondering how do you apply these onto a web app built on Rails. These templates look very similar to wordpress themes. Are they that easy to configure? Is it just as simple as setting up a link to the database to make the fields form capture data? I've been looking at this theme.
For admin templates I recommend using Active Admin. It's relatively easy to implement and gives you great admin screens with little effort.
Yes, You can. I'm trying to solve the same problem and so far I have a couple options:
1.) do it by hand, I've done this before, it works but takes a lot of time to truly understand how your theme is put together. First I would recommend using the included themes assets exactly as they are bundled with the theme. Don't assume that just because you have twitter-bootstrap-rails gem that the bootstrap classes in the theme will work. Link the assets statically and slowly extract out the static assets and replace them in the asset pipeline once you know they work.
2.) Use the strategy suggested in the install_theme gem (http://drnicwilliams.com/2009/10/06/install-any-html-themetemplate-into-your-rails-app/) the gem itself is not maintained any longer (i'm not sure about any forks), but the strategy is sound. Extract the core parts of the template into partials.
The short answer is yes, but there is no straight forward way to "import to rails"
I have a Rails project that is basically a simple web app for a membership-based organization. We've open sourced the code on Github for the web app so that others can use it, but have a licensed design/layout that the original organization is going to use. This layout cannot be open sourced. I was wondering if others have run into the situation where you have an open-source Rails app with a non-OS design.
My initial thought is to put app/views in .gitignore, and to have anyone forking the code add their own views directory, perhaps including an app/views_default directory with a web-app-theme layout or something else to get people running. Is this the best option (realizing that there are other files such as JavaScript, CSS, etc that come with the layout that must also be ignored).
Does anyone have some good thoughts or pointers on this?
Hoopla - svn:externals for Git.
Instead of git:ignore, you can push the non-open-source stuff somewhere else, and your open-source code on github. Use hoopla to manage the externals.
http://6brand.com/git-svn-externals-rails-plugins.html
Rails Theme_Support plugin: http://github.com/aussiegeek/theme_support (There are forks as well). You can create a theme directory with multiple themes, and load the theme programmatically in ApplicationController. This would allow anyone to use the application, and simply supply their own theme in the themes directory, and would allow the project to have a "default" theme which would serve as an example.