Integrating new designs into an old rails application - ruby-on-rails

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!

Related

Rails squishing on bootstrap theme on the sides

So I bought a bootstrap theme and was using it for a side project. The thing is, when used in Rails, it seems to add some additional margins/paddings on the sides so that the layout becomes a bit squished. The CSS is exactly the same so I have no idea what's causing this. Does anyone have experience dealing with something similar? I'm using Rails 4.0 if that makes any difference.
Thank you!
Do you have any CSS files other than the ones supplied by the theme loaded onto your page? scaffolds.css comes immediately to mind.

Can an admin template be used in a Ruby on Rails web app?

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"

Theming a rails app via plugin or engine

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.

Multiple Rails forks with separate designs and layouts

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.

How to create picture slideshows in a rails project? Flash or otherwise

In a rails project how would I create a picture slideshow? It could be generated as flash or use prototype or something else.
I just want a series of images (as a sub-part of a web page, not be the whole page) to fade into each other, and to advance manually if clicked. It would be nice if I could do things like slowly zoom into the images
I imagine there must be a plugin or something to handle this?
Since this is a UI feature, I'd just use the JQuery plugin CycleLite. See this article from Eric Berry on O'Reilly Ruby or, for a Rails solution, this extract from Ruby on Rails: Up and Running.

Resources