What is the app/templates directory for when using Yeoman? - yeoman

As the title suggests I want to know what the app/templates directory is for when using Yeoman.
Thanks

Yeoman team member here.
It's simply meant to put your templates in. Like your Handlebar.js templates or Mustache, etc.
Nothing magic happens when you do, at least not yet. Just a best practice we wanted to enforce.

Related

Replace the default templates that Grails generates

So, i am getting started with Grails and i just started using install-templates! And it is a pretty cool stuff.
I learned that i should modify the installed templates before using generate-all, generate-views or generate-controllers.
But what i couldn't figure out (and also i couldn't find in google) is how to make the changes i have made to the template permanent. A want to make the changes i have made to be used for all the projects i create from now on.
In a nutshell, How can i change the default templates Grails generates?
You have to modify the scaffolding-X.X.X.zip at grails-X-X-X\plugins (the place you installed it) so the generate goes for all the projects.
Go to src/templates/scaffolding and edit the files.

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"

Free Rails 3 scaffold templates?

Does anyone know where I might be able to find free scaffold templates (i.e. .css files)? I'm doing a quick and dirty project, and I'm just looking for something generic, but a bit more visually appealing than the extremely generic default. Actually I'd be especially interested in something that look similar to the Django Admin section, but I'm not that picky, really.
Try this out: https://github.com/pilu/web-app-theme -- it's a basecamp/lighthouse type admin template (including css).
It'll work in both rails 2.3 and rails 3 -- the github readme has details.
I've used the Blueprint CSS Framework (http://www.blueprintcss.org/) for stuff like this in the past.

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.

WYSIWYG image uploads in Rails App

Can anyone recommend a way of creating a view where users can upload images to my app through a WYSIWYG editor?
I've tried solving this using CK Editor and Paperclip but am having lots of trouble... Maybe I'm going about this the wrong way.
If someone's done this before I'd really like to know how! I don't have a editor or file storage mechanism preference so fire away...
This is all dependent on the WYSIWYG's file upload API. From there, just build an ImagesController to handle requests from that API, use whatever system (Paperclip is good) to handle those files internally, and you should be good to go. You won't find a plug-and-play solution; you'll have to hand-roll it.
Turns out that, with more targeted Google searching, you can find a preexisting solution. Here's one for TinyMCE and Rails. You may, however, end up finding that it doesn't meet your needs, in which case I would not be surprised to find that creating your own solution would be simpler than you expect :)
You could try Bootsy. It's a WYSIWYG editor with image upload capability. Includes a (rather simple) image manager as well.
https://github.com/volmer/bootsy
There is an other solution for rails out there:
https://github.com/spohlenz/tinymce-rails
You can load it as gem and configure it via a yml file. And it comes with an extra language gem.

Resources