Coder Social home page Coder Social logo

web-app-theme's Introduction

Web App Theme

Web App Theme is a rails generator by Andrea Franz that you can use to generate admin panels quickly. Inspired by cool themes like Lighthouse, Basecamp, RadiantCMS and others, it wants to be an idea to start developing a complete web application layout.

Web App Theme screenshot

Installation

Rails >= 3.1.0

For this version, all the stylesheets are stored inside the gems assets path. They don't need to be copied to the to the application, unless you want to customize them (using the web_app_theme:assets generator). There only css file generated when you run the theme generator is the web_app_theme.css that includes the theme of your choice. Add to your gemfile:

gem 'web-app-theme', '~> 0.8.0'

Other versions

You can use web-app-theme >= 0.6.2 with Rails 3. If you want to use it with rails 2, use web-app-theme 0.5.3 Specify the web-app-theme gem in your Gemfile, only for :development and :test

group :development, :test do
  gem 'web-app-theme', '>= 0.6.2'
end

Usage

Theme Generator

Used without parameters, it generates the layout inside the application.html.erb file using the default theme.

rails g web_app_theme:theme

You can specify the layout file name in the first parameter:

rails g web_app_theme:theme admin # it will generate a layout called `admin.html.erb`

If you want to use another theme, instead of the default, you can use the --theme option:

rails g web_app_theme:theme admin --theme="drastic-dark"

You can specify the template engine with --engine=name option, where name can be erb (default) or haml:

rails g web_app_theme:theme --engine=haml # you must specify haml in your Gemfile

If you want to generate the stylesheets of a specific theme without changing the previously generated layout you can pass the --no-layout option:

rails g web_app_theme:theme --theme=bec --no-layout

You can specify the text used in the header with the --app-name option:

rails g web_app_theme:theme --app-name="My New Application"

If you need a layout for login and signup pages, you can use the --type option with sign as value. รŒf not specified, the default value is administration

rails g web_app_theme:theme sign --layout-type=sign

Assets Generator

Used to copy a theme of your choice from the gem to your application, without parameters it will copy the 'default' theme

rails g web_app_theme:assets --theme=red

This will copy the theme files on your app/assets/stylesheets/web-app-theme path. Also this will copy theme's images to app/assets/images/web-app-theme path

Themed Generator

Start creating your controllers manually or with a scaffold, and then use the themed generator to overwrite the previously generated views.

If you have a controller named like the plural of the used model you can specify just the first parameter:

rails g web_app_theme:themed posts # you have a model named Post and a controller named PostsController

rails g web_app_theme:themed admin/gallery_pictures # you have a model named GalleryPicture and a controller named Admin::GalleryPicturesController

Use the --layout option specifying the previously generated layout to add a link to the controller you are working on:

rails g web_app_theme:themed posts --layout=admin # you will see the `Posts` link in the navigation

If the controller has a name different to the model used, specify the controller path in the first parameter and the model name in the second one:

rails g web_app_theme:themed items post

rails g web_app_theme:themed admin/items post

If you use will_paginate for pagination use the --will-paginate:

rails g web_app_theme:themed items post --will-paginate

You can specify the template engine with --engine=name option, where name can be erb (default) or haml:

rails g web_app_theme:themed posts --engine=haml

If you have something like map.resource :dashboard in your routes.rb file, you can use the --type=text to generate a view with just text:

rails g web_app_theme:themed dashboards --themed-type=text

If you want to show form error messages inside the generated forms, use the following code inside your environment.rb

ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| 
  if html_tag =~ /<label/
    %|<div class="fieldWithErrors">#{html_tag} <span class="error">#{[instance.error_message].join(', ')}</span></div>|.html_safe
  else
    html_tag
  end
end

If you want to have translated pages, simple create in your locale.yml the keys just like config/locales/en_us.yml example.

en_us:
  web-app-theme: 
    save: Save
    cancel: Cancel
    list: List
    edit: Edit
    new: New
    show: Show
    delete: Delete
    confirm: Are you sure?
    created_at: Created at
    all: All

Contributing

  • Fork this repository.
  • Duplicate the 'themes/default' folder and rename it.
  • Modify the style.css file adding your favorite colors.
  • Add a link to your theme in the 'Switch Theme' block inside the index.html file.
  • Send a pull request.

Links

Author

Andrea Franz - http://gravityblast.com

Contributors

  • Nelson Fernandez
  • Giovanni Intini
  • Jeremy Durham
  • Wouter de Vries
  • Marco Borromeo
  • rick mckay
  • Peter Sarnacki
  • Garret Alfert
  • Mikkel Hoegh
  • Juan Maria Martinez Arce
  • Stas SUSHKOV
  • Daniel Cukier
  • Roberto Klein
  • Bryan Woods
  • Sandro Duarte
  • David Francisco

Credits

web-app-theme's People

Contributors

bowmande avatar bryanwoods avatar danicuki avatar dgnemo avatar dmfrancisco avatar drogus avatar elia avatar galfert avatar gravityblast avatar igmarin avatar jeremydurham avatar jmax avatar jrissler avatar kano4 avatar kascote avatar lloydpick avatar mborromeo avatar mikl avatar mlitwiniuk avatar nathanpsouza avatar pdf avatar reidb avatar sandrods avatar stas avatar tscolari avatar wwdevries avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

web-app-theme's Issues

Errors on Forms not rendered and styled

in Rails 3, the @object.errors are not rendered.

Currently, it appears the best way to render error messages for a form trought the controller, by setting a flash[:error].
I am not sure if that is the cleanest way. Personally I prefer a less DRY way, by defining a simple shared/_error_messages.erb that is included in the forms.

Is the flash[:error] = ... in the Controller the preferred way for web-app-theme? If not, what would be the cleanest way; would such a partial be an option for inclusion?

Mongoid ODM doesn't properly output data types as form fields

In Mongoid when you define for example something like this:

class User
  include Mongoid::Document
  field :firstname, :type => String
  field :lastname, :type => String
  field :admin, :type => Boolean
  field :birthdate, :type => Date
end

It just creates text_field's for all input types, rather than a date select or checkbox for boolean.

https://github.com/pilu/web-app-theme/blob/master/lib/generators/web_app_theme/themed/templates/view_form.html.erb

Cannot install web-app-theme with Ruby 1.9.1

There seems to be a problem when installing web-app-theme as a plugin with Ruby 1.9.

Macintosh:demo19 martin$ script/plugin install git://github.com/pilu/web-app-theme.git

Plugin not found: ["git://github.com/pilu/web-app-theme.git"]

Macintosh:demo19 martin$ ls vendor//plugins/

web-app-theme

Macintosh:demo19 martin$ ls vendor//plugins/web-app-theme/

Macintosh:demo19 martin$

Validation error messages are not shown

I love this project. It's a huge time saver! One thing I've noticed though is that doesn't display the validation errors in the new and edit pages. Seems like it would be important. :) Keep up the good work.

defaults.js Not Created

I'm rather new to Ruby on Rails and Web-App-Theme... and this is the first issue I've ever posted on Github.

When I try even the most basic Rails app with Web-App-Theme, it seems to me that defaults.js is not created. Here's how I tried (I'm using Rails 3.2.0):

rails new testapp
cd testapp
mate .

Then I edit the Gemfile to add the following: gem 'web-app-theme'

Note: adding "gem 'web-app-theme', '> 0.8.0'" gave me errors about compatibility, so I just dropped the '> 0.8.0' part and it worked.

bundle install
rails g scaffold Person name city
rails s

This seems to work fine when I visit http://localhost:3000/people

rails g web_app_theme:theme
rails s

When I go to http://localhost:3000/people I get an error message:

No such file or directory - Asset file not found at '/testapp/public/javascripts/defaults.js'

When I search the testapp directory, there is no file called 'defaults.js' anywhere.

Am I doing something wrong or is this a bug of some sort?

Thanks for your help.

themed generator errors ...

Hi, nice work here. Anyway, I get some issues with "themed generator" for a simple home controller:

root@webby2066:/var/rails/bookuntu# script/generate themed home
uninitialized constant Home
root@webby2066:/var/rails/bookuntu# script/generate themed Home
uninitialized constant Home
root@webby2066:/var/rails/bookuntu# script/generate themed HomeController
undefined method columns' for HomeController:Class root@webby2066:/var/rails/bookuntu# script/generate themed HomeController --layout=application undefined methodcolumns' for HomeController:Class

root@webby2066:/var/rails/bookuntu# grep home config/routes.rb
map.home '', :controller => 'home', :action => 'index'
map.connect '/:action/:id', :controller => 'home'
root@webby2066:/var/rails/bookuntu# cat app/controllers/home_controller.rb
class HomeController < ApplicationController
caches_page :index
end
root@webby2066:/var/rails/bookuntu#

Errors on nested forms not displayed

Hi

I'm having problems getting the validation errors on nested form attributes styled. For example one of the models in my app is 'company' and it accepts nested attributes for 'location'. My new company form has a section for:

<%= f.fields_for :location_attributes do |loc| %>
. . .
<% end %>

The form renders and creates objects fine. But if the location fails validation no error styles are generated (I'm using ActionView::Base.field_error_proc in my environment.rb) although errors in the 'company' portion of the form are highlighted/displayed fine.

Any ideas ?

Thanks

Mat

missing menubar-background.png

I'm seeing this a lot in my logs:

ActionController::RoutingError (No route matches [GET] "/web-app-theme/themes/activo/images/menubar-background.png"):
  actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.8) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.1) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.1) lib/rack/lock.rb:15:in `call'
  rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
  rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
  rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
  rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
  rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
  railties (3.2.8) lib/rails/engine.rb:479:in `call'
  railties (3.2.8) lib/rails/application.rb:223:in `call'
  railties (3.2.8) lib/rails/railtie/configurable.rb:30:in `method_missing'

left sidebar

I need 2 sidebars: left and right.
Do you plan to add this feature?

nested attributes and haml engine

Hi, I was working with nested attributes (something like this http://railscasts.com/episodes/197-nested-model-form-part-2) and I had this error

undefined method `reflect_on_association' for NilClass:Class

I generated haml template with amazing gem but I figured out that into a generic new.html.haml a symbol is used into the form and this generate the error up here on this line

= link_to_add_fields "Add Zone", f, :zones

  = form_for :company, :url => companies_path, :html => { :class => :form } do |f|
    = render :partial => "form", :locals => {:f => f}

so I used this

  = form_for @company, :url => companies_path, :html => { :class => :form } do |f|

and it works fine.

error using themed generator

I'm using Rails 3.1.3, MongoMapper, WebAppTheme with Devise. Not sure what the error is referring to. Thanks.

unknownb88d1219d4fc:gp2 tthai$ rails g web_app_theme:themed organizations
/Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/whiny_nil.rb:48:in method_missing': undefined methodname' for nil:NilClass (NoMethodError)
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/web-app-theme-0.8.0/lib/generators/web_app_theme/themed/themed_generator.rb:82:in block in columns' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/web-app-theme-0.8.0/lib/generators/web_app_theme/themed/themed_generator.rb:82:inreject'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/web-app-theme-0.8.0/lib/generators/web_app_theme/themed/themed_generator.rb:82:in rescue in columns' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/web-app-theme-0.8.0/lib/generators/web_app_theme/themed/themed_generator.rb:78:incolumns'
from (erb):14:in template' from /Users/tthai/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/erb.rb:753:ineval'
from /Users/tthai/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/erb.rb:753:in result' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/file_manipulation.rb:111:inblock in template'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:54:in call' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:54:inrender'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:47:in identical?' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:73:inon_conflict_behavior'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:111:in invoke_with_conflict_check' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:61:ininvoke!'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions.rb:95:in action' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:26:increate_file'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/file_manipulation.rb:110:in template' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/web-app-theme-0.8.0/lib/generators/web_app_theme/themed/themed_generator.rb:116:inblock in generate_erb_views'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/web-app-theme-0.8.0/lib/generators/web_app_theme/themed/themed_generator.rb:115:in each' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/web-app-theme-0.8.0/lib/generators/web_app_theme/themed/themed_generator.rb:115:ingenerate_erb_views'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/web-app-theme-0.8.0/lib/generators/web_app_theme/themed/themed_generator.rb:111:in generate_views' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/web-app-theme-0.8.0/lib/generators/web_app_theme/themed/themed_generator.rb:21:incopy_views'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/task.rb:22:in run' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:118:ininvoke_task'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in block in invoke_all' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:ineach'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in map' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:ininvoke_all'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/group.rb:226:in dispatch' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:389:instart'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/generators.rb:168:in invoke' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/commands/generate.rb:12:in<top (required)>'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in require' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:inblock in require'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in block in load_dependency' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:innew_constants_in'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in load_dependency' from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:inrequire'
from /Users/tthai/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/commands.rb:28:in <top (required)>' from script/rails:6:inrequire'
from script/rails:6:in `

'
unknownb88d1219d4fc:gp2 tthai$

breaks rails generator? scaffolding a different project creates references to web-app-theme

I installed and used web-app-theme for a project a few weeks ago.

Today I created a NEW project from scratch using 'rails new' command. That project does not use web-app-theme.

When I scaffolded that new project the delete button confirm message STILL refers to web-app-theme:

= link_to "Delete", product_path(@Product), :method => "delete", :confirm => "#{t("web-app-theme.confirm", :default => "Are you sure?")}", :class => 'btn'

Even after removing the web-app-theme gem, then removing the rails 3.1.3 gem, then re-installing rails 3.1.3 ge,, the scaffolding still refers to web-app-theme (but only for the DELETE action).

How can rails be 'stuck' referring to web-app-theme, and how can I fix that?

Rails 3.1

In Rails 3.1 the assets must be placed inside the app/assets directory instead of the public directory. Thus:

  • public/stylesheets/web-app-theme must be generated in app/assets/stylesheets/web-app-theme
  • public/images/web-app-theme must be generated in app/assets/images/web-app-theme

In addition, the application.html.erb layout file must be just as follow:

<%= stylesheet_link_tag :application %>
<%= javascript_include_tag :application %>
<%= csrf_meta_tags %>

Access denied Issue

I am deploying on Heroku with the error bellow. I think this issue is indeed with this gem. All I need to do is remove the line listed bellow to correct the error but then of course I loose the styling. I have played around with my file permissions as well to try to fix this with no success. Error only surfaces on production on Development it work(s)(ed) fine.

-.-.-.-.-.-.-.-
ActionView::Template::Error (Permission denied - /disk1/home/slugs/f9f05ea5-2ab1-4918-b8ac-7459be7b393a/mnt/public/stylesheets/.permissions_check.23704990378300.17008.888917):
2:
3:
4: <title>Good Looking</title>
5: <%= stylesheet_link_tag "web-app-theme/base", "web-app-theme/themes/drastic-dark/style", "web-app-theme/override", :cache => true %>
6: <%= javascript_include_tag :defaults, :cache => true %>
7: <%= csrf_meta_tag %>
8:
app/views/layouts/application.html.erb:5:in _app_views_layouts_application_html_erb__477706425_23705034614360_0' app/controllers/tests_controller.rb:7:inindex'

Rails 3 compatibility

I've installed web-app-theme as plugin using:

rails plugin install git://github.com/pilu/web-app-theme.git

This worked fine, but installing the theme using:

rails generate theme
gives a: Could not find generator theme.

I guess the plugin needs to be upgraded to be Rails 3 compatible?

No route matches [GET] "/web-app-theme/themes/default/fonts/museosans_500-webfont.svg"

Started GET "/web-app-theme/themes/default/fonts/museo700-regular-webfont.svg" for 127.0.0.1 at 2013-01-05 17:32:52 +0800

ActionController::RoutingError (No route matches [GET] "/web-app-theme/themes/default/fonts/museo700-regular-webfont.svg"):

Started GET "/web-app-theme/themes/default/fonts/museosans_500-webfont.svg" for 127.0.0.1 at 2013-01-05 17:32:52 +0800

ActionController::RoutingError (No route matches [GET] "/web-app-theme/themes/default/fonts/museosans_500-webfont.svg"):

Permission denied - public folder

When trying to access a deployed application on Heroku, I get the following error:

ActionView::Template::Error (Permission denied - /app/6a14da80-e717-4550-b091-8240c5c50ff4/home/public/stylesheets/.permissions_check.23898592104760.1719.851812)

Works fine when testing the application locally. I've tried to meddle with the permission settings on my public folder, to no avail.

const_get kernel error

hi, in ubuntu 11.04

first i needed to install the gem "therubyracer" to get the generator running

rails g web_app_theme:themed posts --->

/home/jim/.rvm/gems/ruby-1.9.2-p290/gems/web-app-theme-0.8.0/lib/generators/web_app_theme/themed/themed_generator.rb:80:in `const_get': uninitialized constant Kernel::Post (NameError)

same error in rails 3.1 and 3.1.1.rc1

signin and signup views

I'm using the command:
script/generate theme users --type=sign
And the layout called users.html.erb is created.

But when I use the command:
script/generate themed users user --type=sign
The views of signin and signup aren't created.

missing icons

Hi, I was not able to copy those images:

application_edit.png
cross.png
key.png
tick.png

with

rails g web_app_theme:assets

I manually created the folder

{Rails.root}/app/assets/images/web-app-theme/icons

and copied them from gem source.
Am i missing something?
Thank you

is compatible with rails 3.2.1??

Hi web-app-theme is compatible with rails 3.2.1 and asset pipeline?? I can't run bundle command. I recived this message:

In Gemfile:
web-app-theme (> 0.8.0) ruby depends on
rails (
> 3.1.0.rc6) ruby

I use rails 3.2.1 and ruby 1.9.3-p0.

permission denied.

I'm using jruby-1.6.0.rc2 and rails 3.
I've installed gem web-app-them and run:

jruby -S rails g web_app_theme:theme --theme="drastic-dark"
--engine=haml --app-name="MyApp"

I've this error:

org/jruby/RubyFile.java:428:in initialize': Permission denied - /tmp/web-app-theme-haml20110301-12010-r707i1/. (Errno::EACCES) from org/jruby/RubyIO.java:1074:inopen'
from /home/user/jruby/lib/ruby/1.8/fileutils.rb:699:in
remove_entry_secure' from /home/user/jruby/lib/ruby/1.8/tmpdir.rb:131:inmktmpdir'
from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/theme/theme_generator.rb:49:in
generate_haml_layout' from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/theme/theme_generator.rb:20:in copy_layout'
from org/jruby/RubyKernel.java:2039:in send' from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/task.rb:21:in run'
from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:118:in
invoke_task' from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:124:in invoke_all'
from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/core_ext/ordered_hash.rb:73:in
each' from org/jruby/RubyEnumerable.java:701:incollect'
from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:124:in
invoke_all' from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/group.rb:226:in dispatch'
from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/base.rb:389:in
start' from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/generators.rb:163:in invoke'
from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/commands/generate.rb:10:in
(root)' from org/jruby/RubyKernel.java:1038:inrequire'
from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in
require' from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in load_dependency'
from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in
new_constants_in' from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:595:in new_constants_in'
from AbstractScript.java:41:in (root)' from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in load_dependency'
from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in
require' from AbstractScript.java:41:in(root)'
from /home/user/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/commands/generate.rb:17:in
(root)' from org/jruby/RubyKernel.java:1038:inrequire'
from script/rails:6:in `(root)'

cannot load such file -- sexp

I'm using web-app-theme with ruby 1.9.3-head and rails 3.2.8. I'm not able to generate controller and also can't do rake task. It is giving me this error "cannot load such file -- sexp". Can you please suggest any solutions for this problem.?

Thanks

Kernel Error ... uninitialized constant Kernel::Page

Hi, Just had a weird error whilst trying to use the themed generator to get my scaffold looking fantastic of course.

$rails g web_app_theme:themed admin/pages --layout=admin
/Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/themed/themed_generator.rb:80:in const_get': uninitialized constant Kernel::Page (NameError) from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/themed/themed_generator.rb:80:incolumns'
from (erb):11:in template' from (eval):1:intemplate'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/themed/themed_generator.rb:116:in generate_erb_views' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/themed/themed_generator.rb:115:ineach'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/themed/themed_generator.rb:115:in generate_erb_views' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/themed/themed_generator.rb:111:ingenerate_views'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/themed/themed_generator.rb:21:in copy_views' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/task.rb:22:insend'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/task.rb:22:in run' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/invocation.rb:118:ininvoke_task'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/invocation.rb:124:in invoke_all' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/shell.rb:14:inmap'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/core_ext/ordered_hash.rb:73:in each' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/invocation.rb:124:inmap'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/invocation.rb:124:in invoke_all' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/group.rb:226:indispatch'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/base.rb:389:in start' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/railties-3.0.3/lib/rails/generators.rb:163:ininvoke'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/railties-3.0.3/lib/rails/commands/generate.rb:10
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/railties-3.0.3/lib/rails/commands.rb:17
from script/rails:6:in `require'
from script/rails:6

My scaffold is nested under admin and works ok. Is there maybe something I have done wrong?
Any help would be greatly appreciated.

I18n in the view_form generator

I don't understand why you specify I18n in the view_form generator.

Rails can handle this. It causes some problem for me, because it doesn't use the standard api in rails 3, ie. human_attribute_name.

In my case I have a model inside a module, so the code is looking for module/model in my yml file when rails is looking for module.model. I can override the translation module/model but I will translate my attribute twice, which is not DRY.

It can even look into views.labels.model.attribute, so I don't think you need to specify i18n manually.

Can you add requirements

I tried use this gem with haml. It didn`t work. I spent much time, before I found the solution to install ruby_parser gem.

README?

It's a waste that this Rails plugin which seems to kickass have no documentation. Would appreciate just a basic example, takes just a few lines. Maybe more people would extend something they know how it's used fully. I just guessed the most basic stuff, but usually don't rely on things without docs. If you give a hint I could write the docs. =)

Support RTL (right-to-left) languages

It would be great to have RTL support for Hebrew & Arabic. We'd have to basically flip the margin and padding declarations for structural divs so that adding dir="rtl" to the html doesn't cause the layout to look wonky.

Hi I am unable to install Web-app-theme on Rails 4

Hi,
I am newbie to rails I wanted to install web app theme to my rails app. http://blog.bryanbibat.net/2011/09/24/starting-a-professional-rails-3-1-app-with-web-app-theme-devise-and-kaminari/

I have started following these tutorials and as well as Readme file from your repository.
When I try to add to the gem file I am getting the following error

Bundler could not find compatible versions for gem "rails":
In Gemfile:
web-app-theme (> 0.8.0) ruby depends on
rails (
> 3.1.0.rc6) ruby

rails (4.0.2)

Can you please help me to solve it

Themed generator doesn't add "layout" link with --engine=haml

rails g web_app_theme:themed admin/posts Post --layout=admin --engine=haml

Isn't working properly, it's just a small bug. When you run the above command it does create all the views properly, however, the --layout=admin doesn't add the "Posts" link in my navigation bar. It does do it when I use --engine=erb.

The problem I believe is somewhere in this block:

https://github.com/pilu/web-app-theme/blob/master/lib/generators/web_app_theme/themed/themed_generator.rb

# lib / generators / web_app_theme / themed / themed_generator.rb
def copy_views
  generate_views      
  unless options.layout.blank?
    gsub_file(File.join('app/views/layouts', "#{options[:layout]}.html.#{options.engine}"), /\<div\s+id=\"main-navigation\">.*\<\/ul\>/mi) do |match|
      match.gsub!(/\<\/ul\>/, "")
      if @engine.to_s =~ /haml/
        %|#{match}
      %li{:class => controller.controller_path == '#{@controller_file_path}' ? 'active' : '' }
        %a{:href => #{controller_routing_path}_path} #{plural_model_name}
      </ul>|
      else
        %|#{match} <li class="<%= controller.controller_path == '#{@controller_file_path}' ? 'active' : '' %>"><a href="<%= #{controller_routing_path}_path %>">#{plural_model_name}</a></li></ul>|
      end
    end
  end
end

It probably cannot find the match and thus, ignores it completely. Do you see where this is failing? It's not a show stopper as I can just manually add them to the layout but it's a nice feature to have it do it for you. : )

yield head missing

can you add <%= yield :head %> to the application.html.erb layout file.

Rspec view tests fail after theming a scaffold

If I generate a scaffold with

rails g scaffold items

Then run rake, all the specs pass correctly except a couple of pending ones. But if I apply the web-app-theme with

rails g web_app_theme:themed items --with_will_paginate

and then run rake, I start getting errors like:

No route matches {:action=>"edit", :controller=>"items"}
No route matches {:action=>"destroy", :controller=>"items"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.