From 5a18324155c7b3d0c5252aba8abe18c927bbc502 Mon Sep 17 00:00:00 2001 From: Glenn West Date: Thu, 15 Oct 2009 10:45:00 +0800 Subject: [PATCH] Fixed extra quote problem --- README | 19 ++++++++++++++++++- lib/active_jquery.rb | 4 +--- lib/active_jquery_runtime.rb | 4 ++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/README b/README index 5955b40..648f04e 100644 --- a/README +++ b/README @@ -1,6 +1,8 @@ Activejquery ============ - +Oct 15,2009 - Fixed Keyword problems for Ruby 1.8 + Fixed "/" problem breaking javascript includes with namespace + Oct 10,2009 - Start adding better assoc support Oct 10,2009 - Updated to jquery-ui-1.7.2 and jggrid 3.5.2 June 28,2009 - Renameed localsel automatic divid to tablename_select @@ -54,6 +56,15 @@ May 14 2009 - Added support for one line controller. Environment: ======= Designed for Ruby 1.9.1 and Rails 2.3.2 +Initial testing done for Ruby 1.8.x + +Formatting Notes: +================ +Activejquery uses a default view to style the grid, +this is in views/activejquery/show.erb +If you have added addition default styles/views, you may see the +page number box to be squashed. + Routes ======= @@ -61,6 +72,12 @@ You must add a active resource route in config/routes.rb map.resources :airstate +Namespaced Controller route example + + map.namespace :adminspace do |adminspace| + adminspace.resources :user + end + Example ======= diff --git a/lib/active_jquery.rb b/lib/active_jquery.rb index 7db88b6..51e895b 100644 --- a/lib/active_jquery.rb +++ b/lib/active_jquery.rb @@ -13,8 +13,6 @@ class Config def initialize(model_id) @model_id = model_id @model = model_id.to_s.camelize.constantize - pp @model_id - pp @model end def model_name @@ -46,7 +44,7 @@ def setup_ajs if !defined? @ajs @ajs = ActiveJqueryRuntime.new(self.class.active_jquery_config.model,self) @content_for_layout = String.new - @content_for_layout << '' + "\n" + @content_for_layout << '' + "\n" @content_for_layout << @ajs.grid_html() @heading = params[:controller].humanize() @title = @heading diff --git a/lib/active_jquery_runtime.rb b/lib/active_jquery_runtime.rb index 6aef36b..9a9492e 100644 --- a/lib/active_jquery_runtime.rb +++ b/lib/active_jquery_runtime.rb @@ -16,7 +16,7 @@ def find_associated_fields(assoc) def initialize(table,ctlenv) @controller = ctlenv.params[:controller] - @url = @controller + @url = "/" + @controller # To handle namespace properly @tkey = "id" @actions = [:create, :update, :show, :delete, :search] @edit = FALSE @@ -210,7 +210,7 @@ def grid_html() def html_generate(divid = 'list') - @jqgrid_html << '
' + "\n" + @jqgrid_html << '
' + "\n" @jqgrid_html << '
' + "\n" end