What's the best way to go about this? I've tried a bunch of different things but can't quite get the hooks in right. Tons of googling and I can't get it.
I can get everything working right but I cannot seem to override the child apps views/layouts/application.html.erb ... I need to copy over all assets with the gem and have the plugin/engine/gem/whatever's application.html.erb pull from those assets. Help please?
Jquery-UI has a whole spiel on theming, which also allows it to be dynamic across several different themes. Check out http://jqueryui.com/themeroller/
Dont forget about Bootstrap from Twitter. You can just install these and mention the file_name in your layouts and you are good to go.
In fact, in most cases, you can also just copy them in your assets folders and you are ready to go.
Related
I was asked to integrate new designs into an old app, but the designs are completely different from what there is now. Due to the functionalities already there in the app, I had to integrate the design into it. Starting with the homepage, I replaced all the html.erb files but there is a bootstrap theme which is consistent in the background. I also have to integrate new js into the app. Can anyone please guide a newbie through this? Been at it since 2 days and I don't even know where I am going wrong. Working with rails 3.2.13. Any suggestions or advice for the same would be very much welcome too. Thanks in advance.
P.S. Any further information/details needed, will be provided on asking.
I don't know how proficient you are with Rails, but the bottom line is this:
Rails is an MVC framework, meaning all the interface stuff is
contained in the views part of the app
When you want to change the look of the homepage, all you need to do
is go into app/views/home_controller/index.html.erb and edit te
file. That will allow you to change the HTML; the CSS is simply about
replacing / changing the app/assets/stylesheets/application.css
files
If you're trying to integrate bootstrap, I would personally:
remove all the CSS (depending on how much changing you wish to do)
add the bootstrap CSS, apply fixes to the layout files (in app/views/layouts/application.html.erb)
begin to re-design the interface for each view using boot
This is obviously very generalised. Maybe you can post some code to give us an idea as to what you're struggling with directly?
Many thanks!
Every time I create a new Rails application, and for the admin part, I copy the layout and assets from another project to the new project.
I think it's obvious how many problems this approach causes. I am thinking about organizing my layout, and assets in a proper way.
What I have in mind is creating a gem and putting everything in that gem. But before I try that, I wonder if there is a better way for organizing these files?
Gem is good if you want to share codes among apps.
If, like your case, the shared parts have routes/views, an engine would be better suited, which is also a kind of gem. You can check the guide for details: http://guides.rubyonrails.org/engines.html
Did some research on how to style the views of the devise gem, didn't really find much so added some html and a render partial to the external libray to assist with styleing and to continue to offer my users some links. I get this gut instinct that it isn't the right way to do things however. Any online references provided would be greatly appreciated!
It depends on how you did it.
If you just edited the installed gem source, then perhaps that wasn't ideal.
But if you forked the Devise github repo, like 1,270 people have done as of today, you could easily track changes to the source and merge them with your version, contribute your changes back if you wanted, and you could build a gem of your own that you could use in style.
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.