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.
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!
So I've been banging my head on this all day yesterday trying to get PDF rendering to work properly. After trying Prawn and PDFKit, I found that the problem with at least getting it to work at all had to do with wkhtmltopdf on Mac OS 10.7, but now the problem is that it completely ignores any styles I add targeting the pdf, the print media type, and any special templates.
Here is a pastebin of where I'm at now: http://pastebin.com/LW16RYjW
Trying all of these and several others didn't work for me:
http://www.snikt.net/blog/2012/04/26/wicked-pdf/
WickedPDF missing layout
http://akabhilash.wordpress.com/2010/11/27/pdf-generation-with-wicked-pdf-in-rails/
I finally got to this setup:
https://github.com/mileszs/wicked_pdf/issues/87
Not knowing what else to do, I physically copied pdf_helper.rb into my lib/ directory (I don't know why it wasn't there before, or even whether it should've been upon bundling(?))
Can anyone tell me why it doesn't seem to be picking up any of the rendering options in the controller, and how I can get the styles to register without affecting the screen (html) version? Any help would be greatly appreciated. Thanks in advance for your time.
Turn off the middleware, or add the route you are trying to customize in the middleware call as documented in the README.
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"
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.
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.