Skip to content

Commit

Permalink
Fixed country select. Now works with simple_form input.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joost Hietbrink committed Apr 13, 2012
1 parent 63df2dd commit 45419ab
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 16 deletions.
18 changes: 15 additions & 3 deletions admin_interface.gemspec
Expand Up @@ -5,18 +5,18 @@

Gem::Specification.new do |s|
s.name = "admin_interface"
s.version = "2.0.1"
s.version = "2.1.1"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Joost Hietbrink"]
s.date = "2012-03-28"
s.date = "2012-04-13"
s.description = "A Rails admin interface generator. Theme stolen from Redmine. Similar to web-app-theme but better ;)."
s.extra_rdoc_files = [
"README.rdoc"
]
s.files = [
"app/helpers/admin/base_helper.rb",
"app/helpers/admin/country_select_helper.rb",
"app/inputs/country_code_input.rb",
"config/locales/en.yml",
"lib/admin_interface.rb",
"lib/admin_interface/engine.rb",
Expand Down Expand Up @@ -63,6 +63,10 @@ Gem::Specification.new do |s|
s.add_development_dependency(%q<geminabox>, [">= 0"])
s.add_development_dependency(%q<jeweler>, [">= 0"])
s.add_development_dependency(%q<geminabox>, [">= 0"])
s.add_development_dependency(%q<jeweler>, [">= 0"])
s.add_development_dependency(%q<geminabox>, [">= 0"])
s.add_development_dependency(%q<jeweler>, [">= 0"])
s.add_development_dependency(%q<geminabox>, [">= 0"])
s.add_runtime_dependency(%q<kaminari>, [">= 0.12.4"])
s.add_runtime_dependency(%q<ransack>, [">= 0"])
s.add_runtime_dependency(%q<inherited_resources>, [">= 1.2.2"])
Expand All @@ -81,6 +85,10 @@ Gem::Specification.new do |s|
s.add_dependency(%q<geminabox>, [">= 0"])
s.add_dependency(%q<jeweler>, [">= 0"])
s.add_dependency(%q<geminabox>, [">= 0"])
s.add_dependency(%q<jeweler>, [">= 0"])
s.add_dependency(%q<geminabox>, [">= 0"])
s.add_dependency(%q<jeweler>, [">= 0"])
s.add_dependency(%q<geminabox>, [">= 0"])
s.add_dependency(%q<kaminari>, [">= 0.12.4"])
s.add_dependency(%q<ransack>, [">= 0"])
s.add_dependency(%q<inherited_resources>, [">= 1.2.2"])
Expand All @@ -100,6 +108,10 @@ Gem::Specification.new do |s|
s.add_dependency(%q<geminabox>, [">= 0"])
s.add_dependency(%q<jeweler>, [">= 0"])
s.add_dependency(%q<geminabox>, [">= 0"])
s.add_dependency(%q<jeweler>, [">= 0"])
s.add_dependency(%q<geminabox>, [">= 0"])
s.add_dependency(%q<jeweler>, [">= 0"])
s.add_dependency(%q<geminabox>, [">= 0"])
s.add_dependency(%q<kaminari>, [">= 0.12.4"])
s.add_dependency(%q<ransack>, [">= 0"])
s.add_dependency(%q<inherited_resources>, [">= 1.2.2"])
Expand Down
8 changes: 0 additions & 8 deletions app/helpers/admin/country_select_helper.rb

This file was deleted.

10 changes: 10 additions & 0 deletions app/inputs/country_code_input.rb
@@ -0,0 +1,10 @@
# Simple Form gem custom input (see: https://github.com/plataformatec/simple_form).
#
# Usage (in your simple_form):
# <%= form.input :country_code, :as => :country_code %>
#
class CountryCodeInput < SimpleForm::Inputs::Base
def input
@builder.country_code_select(attribute_name, input_options.delete(:priority), input_html_options) #, priority_countries, options)
end
end
2 changes: 1 addition & 1 deletion lib/admin_interface/version.rb
Expand Up @@ -2,7 +2,7 @@
module AdminInterface
module Version
MAJOR = 2
MINOR = 0
MINOR = 1
PATCH = 1
BUILD = nil

Expand Down
Expand Up @@ -3,7 +3,7 @@
<%%= link_to 'Destroy', [:admin, @<%= singular_name %>], :confirm => 'Are you sure?', :method => :delete, :class => 'icon icon-del' %>
</div>

<h2>Editing <%= singular_name %></h2>
<h2>Editing <%= singular_name.humanize %></h2>

<%%= simple_form_for(@<%= singular_name %>, :url => [:admin, @<%= singular_name %>], :html => {:class => 'tabular'}) do |form| %>
<%%= form.error_messages %>
Expand Down
@@ -1,5 +1,5 @@
<div class="contextual">
<%%= link_to 'New <%= singular_name %>', new_admin_<%= singular_name %>_path, :class => 'icon icon-add' %>
<%%= link_to 'New <%= singular_name.humanize %>', new_admin_<%= singular_name %>_path, :class => 'icon icon-add' %>
| <%%= search_form_for @search, :url => collection_url do |f| %>
<%%
# Check https://github.com/ernie/ransack for options.
Expand Down
@@ -1,4 +1,4 @@
<h2>New <%= singular_name %></h2>
<h2>New <%= singular_name.humanize %></h2>

<%%= simple_form_for(@<%= singular_name %>, :url => [:admin, @<%= singular_name %>], :html => {:class => 'tabular'}) do |form| %>
<%%= form.error_messages %>
Expand Down
Expand Up @@ -3,7 +3,7 @@
<%%= link_to 'Destroy', [:admin, @<%= singular_name %>], :confirm => 'Are you sure?', :method => :delete, :class => 'icon icon-del' %>
</div>

<h2><%= singular_name.capitalize %> <%%= @<%= singular_name %>.id %></h2>
<h2><%= singular_name.humanize %> <%%= @<%= singular_name %>.id %></h2>

<div class="box">
<% for attribute in attributes -%>
Expand Down

0 comments on commit 45419ab

Please sign in to comment.