Passing parameters to TinyMce Bridge

2014-03-21 Thread Soren Christensen
Hi,

Seems that never version of AS has dropped support from loading the TinyMCE 
configuration from the multiple configurations config.yml file as supported and 
outlined by the tinymce-rails gem.

Would there be anything wrong with extending the TinyMce Bridge to use this 
configuration scheme. Obviously it would assume that the bridge depends upon 
tinymce-rails but that is the whole point of the bridge anyway - right ?

If there was a way to specify the configuration in the options to the column 
rather than specifying the entire configuration I for sure would be happy not 
to have to copy and update each controller that uses TinyMCE - Simpler and much 
DRY'er. So something like
config.columns[:description].options = {:html_options = [[:rows, '30'], 
[:cols, '120']], :tinymce = tiny_mce_config(:advanced, options)}

The tinymce-rails gem already provide a helper method that does most of the 
work - tinymce_configuration(config=:default, options={}). Seems like that just 
needs to be referenced in the Bridge code.

Objections or comments ?

BTW - Has anyone had any success with using version 4 of TinyMCE with AS ??

/S

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails Gem group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to activescaffold+unsubscr...@googlegroups.com.
To post to this group, send email to activescaffold@googlegroups.com.
Visit this group at http://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.


ActiveScaffoldExport - As a delayed job

2012-12-12 Thread Soren Christensen
Hi,

Has anyone moved the actual export action form ActiveScaffoldExport to a 
DelayedJob worker or similar background task.

I took a pass at it yesterday, but I need to find a way to get the 
active_scaffold_config made available to the worker. Passing it directly 
through the Enque method generates a huge amount of data (in my case) and 
therefore a no-go.

Has anyone done this a DelayedJob based exporter, or have any suggestions as to 
how one would get access to active_scaffold_config inside of the worker.

/S

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



FriendlyId and ActiveScaffold

2012-11-13 Thread Soren Christensen
Hi,

I have started to use FriendlyID with AS (still v2.4) to obfuscate the ID of 
the various records to prevent nosy users from guessing the ID of other records.
While obfuscation is nice it still needs to be paired with a strong set of 
access rules - but that is outside of this discussion.

I was wondering if there is a way to configure AS to always use the friendly_id 
instead of the id on a global level ?

Pointers? Comments ?

/S

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Redirect after CRUD Action

2012-08-28 Thread Soren Christensen
Hi,

I tried to find a way to send the user to a specific location after one of the 
standard CRUD actions in AS 2.4, but I keep banging my head into the double 
render problem.

Has anyone successfully done this, or have a few good clues to share ?

/S

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Combining a lightbox with AS

2012-06-23 Thread Soren Christensen
Hi,

I use the Pirobox Lightbox along with AS 2.4 to create a lightbox with various 
content.

I noticed that after I have done a search and AS has redrawn the content on the 
screen my Lightbox no longer works.

I load the Lightbox JS code through the layout, and it activates itself on the 
various links you have on the page by doing this:

var my_gall_obj = $('*[class*=pirobox]');

This is based on Jquery which I load before Prototype like this:

10  %= render :partial = 'layouts/jquery.html.erb' %
11  %= javascript_tag('jQuery.noConflict();') -%
12 
13  %= javascript_include_tag 'prototype', 'effects', 'dragdrop', 'controls', 
'application' -%

Can anyone that understands more of the AS, Prototype  jQuery interactions 
outline how to do this such that both AS and the LightBox works. 

/S

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Updating both a nested row and the parent row

2012-06-21 Thread Soren Christensen
Hi,

I have an Active Scaffold based controller (A), and an associated 
controller(B). I use a nested action to display some of the relationship.

In Controller B I have an action that removes an entry - similar to delete.

Upon triggering this action I would like AS to do the following:

1 - Remove the row corresponding to the entry removed

2 - Update the corresponding row in the Controller A, while keeping the nested 
section open.

Alternatively - we can close the nested view, update the row, and re-open the 
nested view

Any pointers on how to do this ?

/S

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Field Search and date_picker

2012-05-29 Thread Soren Christensen
Hi,

I'm trying to get the date picker columns to work with field_search in a Rails 
2.3 application.

I have created search overrides for the column with the date picker, but the 
parameters that are passed to the override does not contain any of the data 
from the search form.

Besides the obvious answer of upgrading the Rails 3.2 is there something that 
can be done to get date picker and field_search to work together under the AS 
2.3 branch.

Also - it looks like the code path that determines the joins for the Count that 
AS performs as the first part of the Index action is different that the code 
path that determines the Joins for the field search action.
Has anyone encountered anything similar, or have any good pointers to suggest 
where to find this issue in the code ?

/S

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Association link with Polymorphic models

2012-02-22 Thread Soren Christensen

I should have written that I'm still on 2.3.14.

Is there some new code for Polymorphic links in 3.2 that I might look at back 
porting to 2.3 ?

/S

On Feb 22, 2012, at 3:16 AM, Sergio Cambra wrote:

 I have checked with latest active scaffold (3.2.0) and it works
 
 On Domingo, 12 de febrero de 2012 18:06:56 Soren escribió:
 Hi
 
 I have a simple test that uses a Polymorphic relationship - see below
 - and grossly simplified.
 
 Running this through the obvious AS controllers behaves as one would
 expect. You can create orders from the various Customer controllers
 and things are just fine.
 However, I need to have a way to explore the data about the customer
 from the orders controller.
 
 Crudely(very!!) this can be done by mimicking a show_action. So if one
 places this in orders_helper.rb:
 def order_customer_column(record)
 a href='/customer1s/#{record.customer_id}?
 _method=getparent_controller=orders' class='show action order'
 id='as_orders-customer1s-show-#{record.customer_id}-link'
 position='after'#{record.customer.name}/a
 end
 I get a show action - and I can turn it into an edit etc etc - Ugly!
 
 But there must be a better way to do this - and preferably one that
 gives me access to the customers as a nested action - just like the
 order_items in the code above.
 
 This ought to be obvious - but I have stared at it so long I can not
 see it. Suggestions ?
 
 Code:
 class Customer1  ActiveRecord::Base
 has_many :orders, :as = :customer
 end
 
 class Customer2  ActiveRecord::Base
 has_many :orders, :as = :customer
 end
 
 class Order  ActiveRecord::Base
  belongs_to :customer, :polymorphic = true
  has_many :order_items
 end
 
 class OrderItem  ActiveRecord::Base
  belongs_to :order
 end
 class Customer1sController  ApplicationController
  active_scaffold :customer1s do |config|
  end
 end
 
 class Customer2sController  ApplicationController
  active_scaffold :customer2s do |config|
  end
 end
 
 class OrderItemsController  ApplicationController
  active_scaffold :order_items do |config|
  end
 end
 
 class OrdersController  ApplicationController
  active_scaffold :orders do |config|
  end
 end
 
 
 /S
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 ActiveScaffold : Ruby on Rails plugin group.
 To post to this group, send email to activescaffold@googlegroups.com.
 To unsubscribe from this group, send email to 
 activescaffold+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/activescaffold?hl=en.
 

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Customizing search

2011-12-07 Thread SOREN CHRISTENSEN
Hi,

I use live search in my AS powered controllers, but I need to be able to
search a little more clever on associated columns.

I have successfully used the config.columns[column_name].search_sql to
customize what is in the 'expression' portion of the query, but I also need
to be able to customize what goes into the value portion of the query.

On the Wiki's page on Search-Overrides (the bottom paragraph) its described
how one can construct the entire component of the search.
I'm trying to use this to perform a search on a column that has an
enumeration on in.

My controller now has this action defined:

def self.condition_for_page_column(column, value, like_pattern)
  [#{column.search_sql} IS ?, SCREEN_TYPES.index(value)]
end

But the action is never called ­ Does this not work for Live searches or is
something additional required to activate this ?

/S



-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Calculations on Virtual Columns

2011-10-20 Thread SOREN CHRISTENSEN
Hi,

The helper method name seems to be off - likely something related to how I
ported the code to the 2.3 environment, or a difference between Rails2 and
Rails3.
The override_formatter is in render_column_calculations set to:
render_amount_#Proc:0x00010e969380@/.._controller.rb:39

Is there some setup of the Proc that happens elsewhere that I have missed ?
Do you have an example of the Proc doing formatting as well ?

/S



On 10/20/11 12:27 AM, Sergio Cambra .:: entreCables S.L. ::.
ser...@entrecables.com wrote:

On Miércoles, 19 de Octubre de 2011 21:04:45 SOREN CHRISTENSEN escribió:
 Excellent.
 
 Forgot to say that I'm in 2.3 but back ported the proc ability to
 AS2.3/2.4.
 
 How to you override the formatting for the calculation, or is the proc
 supposed to return everything ?
 

You should define render_quantity_sold_sum method to formatting the
calculation
Or you can format it in the proc

 /S
 
 On 10/19/11 5:20 AM, Sergio Cambra .:: entreCables S.L. ::.
 
 ser...@entrecables.com wrote:
 On Martes, 18 de Octubre de 2011 00:57:23 SOREN CHRISTENSEN escribió:
  Hi,
  
  Has anyone put in the effort to get the standard ActiveScaffold
  calculations work on Virtual Coulmns?
  
  Quantity_sold is a virtual column defined in the model (as opposed to
 
 being
 
  a database column). But AS does not support calculations for those.
  
  config.columns[:quantity_sold].calculate = :sum
  
  Is this doable with reasonable effort ?
  
  /S
 
 You must set a proc, for example:
 
 config.columns[:quantity_sold].calculate = proc{|records|
 records.map(:quantity_sold).sum}

-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com

-- 
You received this message because you are subscribed to the Google Groups
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Calculations on Virtual Columns

2011-10-19 Thread SOREN CHRISTENSEN
Excellent.

Forgot to say that I'm in 2.3 but back ported the proc ability to
AS2.3/2.4.

How to you override the formatting for the calculation, or is the proc
supposed to return everything ?

/S

On 10/19/11 5:20 AM, Sergio Cambra .:: entreCables S.L. ::.
ser...@entrecables.com wrote:

On Martes, 18 de Octubre de 2011 00:57:23 SOREN CHRISTENSEN escribió:
 Hi,
 
 Has anyone put in the effort to get the standard ActiveScaffold
 calculations work on Virtual Coulmns?
 
 Quantity_sold is a virtual column defined in the model (as opposed to
being
 a database column). But AS does not support calculations for those.
 
 config.columns[:quantity_sold].calculate = :sum
 
 Is this doable with reasonable effort ?
 
 /S

You must set a proc, for example:

config.columns[:quantity_sold].calculate = proc{|records|
records.map(:quantity_sold).sum}

-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com

-- 
You received this message because you are subscribed to the Google Groups
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Calculations on Virtual Columns

2011-10-17 Thread SOREN CHRISTENSEN
Hi,

Has anyone put in the effort to get the standard ActiveScaffold calculations
work on Virtual Coulmns?

Quantity_sold is a virtual column defined in the model (as opposed to being
a database column). But AS does not support calculations for those.

config.columns[:quantity_sold].calculate = :sum

Is this doable with reasonable effort ?

/S


-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



ActionLinks fails from Embedded Scaffolds

2011-06-23 Thread SOREN CHRISTENSEN
Hi,

I have several ActionLinks that I use extensively all over my app.

I have several of these being used in embedded versions. But the ActionLinks
that I have added using:
 
54  config.action_links.add groups,
 55:controller = product_groups,
 56:action = :index,
 57:label = Product Groups,
 58:page = true

All have an eid parameter set on them, and therefore fails.

How do I get rid of the EID?

/S


-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Using action_link as a one line input form

2011-06-08 Thread SOREN CHRISTENSEN
Hi,

Does anyone have a good way to create a one line input form to use on say an
approve action.

I would like to use an action_link and once clicked it should pop up a
window to ask for a single value as input to the method.

Any suggestions on how to do this ?

/S




-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Is ActionAfterCreate Broken ?

2011-01-26 Thread SOREN CHRISTENSEN
Have the configuration previously described, which has worked.
But after the latest update action_after_create does not case the new code
to get executed after a create action.

/S

On 1/26/11 12:44 AM, Sergio Cambra .:: entreCables S.L. ::.
ser...@entrecables.com wrote:

On Miércoles, 26 de Enero de 2011 03:17:24 SOREN CHRISTENSEN escribió:
 I have
 
 config.create.action_after_create = :post_create
 
 In one of my controllers.
 
 Is this broken in the current version of Master (2011-01-12)

It shouldn't be broken. Please explain in more detail your problem

 
 /S

-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com

-- 
You received this message because you are subscribed to the Google Groups
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Prototype 1.7.0.0

2011-01-25 Thread SOREN CHRISTENSEN
Hi,

Is there any problems running AS with prototype 1.7.0.0 ?

I have the older 1.6.0.3 and have a conflict that urging me to upgrade to
1.7.0.0.

/S



-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Is ActionAfterCreate Broken ?

2011-01-25 Thread SOREN CHRISTENSEN

I have 

config.create.action_after_create = :post_create

In one of my controllers.

Is this broken in the current version of Master (2011-01-12)

/S



-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: nested scaffold labels changed to {{nested_model}} for {{parent_model}}

2011-01-06 Thread Soren Christensen
Something changed in i18n above 0.4.1

Just require that version and you are fine.

Similar problem can also be seen on your validation messages (if any?), so just 
freeze this gem requirement.

/S



On Jan 6, 2011, at 5:26 PM, Noah wrote:

 Hi, removing the i18n gem fixed this problem for me on rails 2.3.8
 
 -N
 
 On Dec 30 2010, 12:54 am, Sergio Cambra .:: entreCables S.L. ::.
 ser...@entrecables.com wrote:
 On Jueves, 30 de Diciembre de 2010 05:34:29 RFine escribió:
 
 Thanks, but any idea why all my table names and associations would be
 {{model}} ...?
 
 I think rails try to replace %{model} with the right string, but i18n strings
 in rails-2.3 branch has {{model}} instead of %{model}
 
 
 
 
 
 Still can't figure it out.
 
 R
 
 On Dec 29, 5:48 am, Sergio Cambra .:: entreCables S.L. ::.
 
 ser...@entrecables.com wrote:
 On Martes, 28 de Diciembre de 2010 18:20:27 RFine escribió:
 Got that fixed... not sure why but had an extra parm in
 render_action_link... now fixed.
 
 However, still have the same problem with all models not returning
 their names.  Same as before but with latest version.
 
 You should use master branch with rails 2.3.8 due to i18n change. You
 will have to update your helpers override, second argument is no more
 the field name, is an options hash.
 
 Russell
 
 On Dec 28, 9:13 am, RFine rfmp...@gmail.com wrote:
 I just updated to the latest 2.3 release of AS, and all my pages
 return this error:
 
 ActionView::TemplateError (wrong number of arguments (4 for 3)) on
 line #8 of vendor/plugins/active_scaffold/frontends/default/views/
 _list_header.html.erb:
 5:   % next if skip_action_link(link) -%
 6:% next if link.action == 'new'  params[:nested].nil? 
 active_scaffold_config.list.always_show_create %
 7:% next if link.action == 'show_search' 
 active_scaffold_config.list.always_show_search %
 8:   %= render_action_link(link, new_params) -%
 9: % end -%
 10:
 11: %= loading_indicator_tag(:action = :table) %
 
 Now I'm really down the rabbit hole ;(.
 
 R
 
 On Dec 28, 8:39 am, David Cato o...@crunchyfrog.net wrote:
 RFine wrote ...
 
 OK, I also just noticed that when I add amodel, the title is:
 
 Create {{model}}
 
 However, it does actually work.  Something is very odd here...
 
 Ever seen anything like this?
 
 There were some I18n changes between Rails 2.3.5 and 2.3.8 which
 included changing replacable params in locale files from {{param}}
 to %{param}.
 
 Make sure you're using the latest version of AS, which has updated
 locale files, with Rails 2.3.8.
 
 --
 David Cato
 
 --
 Sergio Cambra .:: entreCables S.L. ::.
 Mariana Pineda 23, 50.018 Zaragoza
 T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com
 
 --
 Sergio Cambra .:: entreCables S.L. ::.
 Mariana Pineda 23, 50.018 Zaragoza
 T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 ActiveScaffold : Ruby on Rails plugin group.
 To post to this group, send email to activescaff...@googlegroups.com.
 To unsubscribe from this group, send email to 
 activescaffold+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/activescaffold?hl=en.
 

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Freelance?

2010-12-10 Thread Soren Christensen

I spend a lot of time with AS, and work remotely without hand holding.

Tell me what you are looking for and when

What are you willing to pay

-S


On Dec 9, 2010, at 9:29 PM, mario wrote:

 Hi,
 
 I'm working with a client on a project that we're looking to build a
 backend with ActiveScaffold. Does anyone know any good freelancers who
 might be available and have a good head to run with things without a
 lot of supervision?
 
 I'm very familiar with active scaffold, but don't have the time.  This
 is for remote work.
 
 Thanks!
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 ActiveScaffold : Ruby on Rails plugin group.
 To post to this group, send email to activescaff...@googlegroups.com.
 To unsubscribe from this group, send email to 
 activescaffold+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/activescaffold?hl=en.
 

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



conditions_for_collections and nested actions

2010-11-07 Thread Soren Christensen
Hi,

I have a set of relations where I use a conditions_for_collections to control 
what is happening.

When I create a new item through the nested relation I get all of the items in 
the nested model, and not the ones filtered through the 
conditions_through_collection.

Do I need to move by filter into the actual model association as a :condition 
there, or is there an AS structure that I should use instead ?

/S

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: TemplateError Controller missing ActiveScaffold in line #14...

2010-10-28 Thread Soren Christensen

Post the ActiveScaffold configuration portion of the two controllers in 
question.
Post the model associations between project and proposals.

Make sure that you have your routes correctly configures with:
  map.resources :projects, :active_scaffold = true
  map.resources :proposals, :active_scaffold = true


On Oct 28, 2010, at 8:16 PM, anithri wrote:

 Updating my project to rails 2.3.8 and the latest ActiveScaffold.
 However, this has broken some of my controllers and I can't figure out
 why.
 
 I have a Project model that used to use the following controllers.
 
 ProjectsController (non AS, used for a myriad of purposes including
 Project Creation and Edit forms, those required more customization
 than I could handle in AS)
 AjaxController (AS, main view for Projects)
 ProposalsController (AS, specialized view of some of Projects, limited
 by user, meant to be updated frequently without the hassle of having
 to edit the entire document)
 
 These worked great before the update, now not so much.
 
 I'm getting this error, when I try to Show or Edit in the
 ProposalsController.
 
 code
 Processing ProposalsController#edit (for 127.0.0.1 at 2010-10-28
 11:38:47) [GET]
  Parameters: {action=edit, _method=get,
 adapter=_list_inline_adapter, id=5687,
 controller=proposals}
 Project Load (0.7ms)  SELECT * FROM `projects` WHERE (`projects`.`id`
 = 5687)
 
 ActionView::TemplateError (ProjectsController missing ActiveScaffold)
 on line #14 of vendor/plugins/active_scaffold/frontends/default/views/
 _form.html.erb:
 11:   /li
 12:   % else -%
 13:   li class=form-element %= 'required' if column.required? % 
 %= column.css_class unless column.css_class.nil? %
 14: %= render :partial =
 form_partial_for_column(column), :locals = { :column = column } -%
 15:   /li
 16:   % end -%
 17:   % end -%
 
vendor/plugins/active_scaffold/frontends/default/views/
 _form.html.erb:14
vendor/plugins/active_scaffold/frontends/default/views/
 _form.html.erb:2
vendor/plugins/active_scaffold/frontends/default/views/
 _update_form.html.erb:45
 
 Rendered rescues/_trace (120.5ms)
 Rendered rescues/_request_and_response (1.7ms)
 Rendering rescues/layout (internal_server_error)
 /code
 
 I've seen a few posts about using active_scaffold_controller_for and
 using it in the ProposalsController does allow me to use show/edit.
 Is this the right approach to use in my case?  Maybe to make things
 easier for future users we should add a decorator for a Controller
 (active_scaffold_for :project)  to make it easier to setup corner
 cases like this?  Or is there something else I'm doing wrong?
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 ActiveScaffold : Ruby on Rails plugin group.
 To post to this group, send email to activescaff...@googlegroups.com.
 To unsubscribe from this group, send email to 
 activescaffold+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/activescaffold?hl=en.
 

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



2.3.8 datetime fields

2010-06-11 Thread Soren Christensen


Hi,

Were just forced into a 2.3.8 upgrade. Almost functional - but a few 
things are broken.


Rather than getting the standard Date/Time Select Icon I get the full 
HTML to get to the there.


  1.

 img alt=Calendar class=calendar_date_select_popup_icon
 onclick=new CalendarDateSelect( $(this).previous(),
 {time:true, year_range:10} );
 src=/images/calendar_date_select/calendar.gif?1276051808
 style=border:0px; cursor:pointer; /

  2.


Did something change as far as the Date/Time fields or is this just a bug.

I'm on the master branch with the last commits show as 6/10/2010.

/S



--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: tiny_mce is not rendering with active_scaffold

2010-05-28 Thread Soren Christensen

did you set the form_ui as per the wiki:

http://wiki.github.com/activescaffold/active_scaffold/api-column

/S



On May 27, 2010, at 5:00 PM, stephen murdoch wrote:

 it's difficult to find instructions on how to get the two running.
 
 I've followed along from the readme at github for tiny_mce:
 http://github.com/kete/tiny_mce
 
 I did script/plugin install on the tiny_mce plugin
 Then I ran rake tiny_mce:install and watched the files get copied over
 to the right places.
 I have = active_scaffold_includes in my application.html.haml file
 I have put uses_tiny_mce into my posts_controller
 
 But when I view my create form, I just get a stanard textarea with no
 tiny_mce buttons...
 
 Am I installing it wrongly?
 I've also configured the tiny_mce.yml file.
 
 Active Scaffold works great, but I've been trying to get tiny_mce
 running for hours now.
 
 I'm on rails 2.3.8, but this is seen in 2.3.5 too.
 
 Should I be using the gem?  Is that the problem?  I had some problems
 getting the gem to install on Heroku so I started using the plugin...
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 ActiveScaffold : Ruby on Rails plugin group.
 To post to this group, send email to activescaff...@googlegroups.com.
 To unsubscribe from this group, send email to 
 activescaffold+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/activescaffold?hl=en.
 

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



finder_sql

2010-05-24 Thread Soren Christensen
Hi,

I need to tweak a HABTM relationship inorder to resue a table that I already 
have and actively maintain.

But I need to tweak the HABTM configuration. Unfortunately AS overrides the 
finder_sql option on a HABTM relation. Try this:

  has_and_belongs_to_many :employers,
   :class_name = 'Employer',
   :foreign_key = 'user_id',
   :join_table = employers_users,
   :association_foreign_key = 'employer_id',
   :finder_sql = 'yada yada'

The yada yada gets ignored by AS and never triggers an error. 

I need the SQL to select employers based on the user_id field rather than the 
id field of the current model.

So I should really create another table with the correct name and recreate all 
the associations. But that is such a waste - So instead I would rather use the 
employers_users table that I have and reuse it. But again - I need to look up 
entries in this table based on this models user_id - not the regular ID that AS 
does.

/S


-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Overriding the '-' in nested views

2010-05-21 Thread Soren Christensen

Thanks Sergio !

After reading the source I found that it is possible to just define 

config.list.empty_field_text = 'Add'

in your controller. That works just fine. I was only after overriding the value 
when the nested column was empty.

Unfortunately this can not be defined as other parameters on a per column basis 
such as
config.columns[:apply_amount].calculate = :sum

It is global for the entire controller. Could be a great enhancement.


Thanks for the link to the CSS.

How do I use ActionLink to create nested actions ?

/S


On May 21, 2010, at 12:47 AM, Sergio Cambra .:: entreCables S.L. ::. wrote:

 On Jueves, 20 de Mayo de 2010 17:38:25 Soren Christensen escribió:
 Hi,
 
 I have a rather simple nested setup with AS.
 
 The standard index view is exactly what I need, but my users are asking if
 the - (dash) could be changed such that it was more obvious that one can
 create a new element by clicking that character.
 
 Is there some convenient place to over ride this, or do I need to create a
 new helper method to over ride this column? And if so - where is the
 current helper method to start from ?
 
 Related to this is the following question:
 How do one create an action_link that creates a new element in the nested
 controller ?
 
 You will have to override render_list_column when column is an empty plural 
 association, and set some parameters in the url. Look at current 
 implementation in list_column_helpers, line 47
 
 
 And did we ever figure out a way to place images in the labels for
 action_links ?
 
 You can do it with CSS, I explained it here:
 http://groups.google.com/group/activescaffold/browse_thread/thread/53a3aae729fad680/dd950daf03b4a99f?lnk=gstq=CSS#dd950daf03b4a99f
 
 -- 
 Sergio Cambra .:: entreCables S.L. ::.
 Mariana Pineda 23, 50.018 Zaragoza
 T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 ActiveScaffold : Ruby on Rails plugin group.
 To post to this group, send email to activescaff...@googlegroups.com.
 To unsubscribe from this group, send email to 
 activescaffold+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/activescaffold?hl=en.
 

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Overriding the '-' in nested views

2010-05-20 Thread Soren Christensen
Hi,

I have a rather simple nested setup with AS.

The standard index view is exactly what I need, but my users are asking if the 
- (dash) could be changed such that it was more obvious that one can create a 
new element by clicking that character.

Is there some convenient place to over ride this, or do I need to create a new 
helper method to over ride this column? And if so - where is the current helper 
method to start from ?

Related to this is the following question:
How do one create an action_link that creates a new element in the nested 
controller ?

And did we ever figure out a way to place images in the labels for action_links 
?

/S

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Active Scaffold breaks Mongrel

2010-05-20 Thread Soren Christensen

Are you running a small test setup that you can post or is this something much 
bigger.

/S



On May 20, 2010, at 9:11 AM, RichardOnRails wrote:

 The pastie I reference in my previous response may be of code I ran
 prior to moving the silencer to temp.
 
 So I re-ran the WEBrick startup and posted the results to
 http://www.pastie.org/969604.  I hope that helps you in your efforts
 to help me.
 
 Best wishes,
 Richard
 
 On May 20, 2:34 am, mrbana...@googlemail.com
 mrbana...@googlemail.com wrote:
 Hi,
 
 1.  I can assure you, that activescaffold is working with Rails 2.3.5
 and mongrel in general. :-)
 2. can you please try to start with webrick and please remove any
 backtrace silencers (conf/initiliazers)
 
 If webrick also fails please send the complete backtrace and
 additional plugins you are using.
 
 --
 Volker
 
 On May 19, 6:11 pm, RichardOnRails
 
 
 
 richarddummymailbox58...@uscomputergurus.com wrote:
 Hi,
 
 I downloaded/installed Active Scaffold plug-in into a Rails 2.3.5
 application using the link without an -r option in Getting Started/
 Installing.
 
 I followed the Your First ActiveScaffold instructions exactly, I
 think.  (I misunderstood them on my previous try, despite the fact
 that they're well written.)
 
 I then read in Starting to Configure that Your scaffold should be
 up and running with default everything right now.
 
 But when I started up my web-server, Mongrel, it crashed with the
 symptom:
 
 = Booting Mongrel
 = Rails 2.3.5 application starting onhttp://0.0.0.0:3000
 K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
 activesupport-2.3.5/lib/active_support/core_ext/module/aliasing.rb:
 33:in `alias_method': unde
 fined method `_pick_template' for class `ActionView::Base' (NameError)
 from K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
 activesupport-2.3.5/lib/active_support/core_ext/module/aliasing.rb:
 33:in `alias_
 method_chain'
 
 I found a June 2009 solution posted 
 athttp://earlruby.org/2009/06/getting-activescaffold-to-work-under-ruby...
 claiming the following two installations solved the undefined method
 `_pick_template' problem:
 script/plugin install git://github.com/activescaffold/active_scaffold.git
 -r master
 script/plugin install git://github.com/ewildgoose/render_component.git
 -r rails-2
 
 When I tried the first on these I got:
 K:\_Projects\Ruby\_Rails_Apps\_EIMS\RTS\vendorruby script/plugin
 install git://github.com/activescaffold/active_scaffold.git -r master
 ruby: No such file or directory -- script/plugin (LoadError)
 
 Any ideas?
 --
 Richard
 
 --
 You received this message because you are subscribed to the Google Groups 
 ActiveScaffold : Ruby on Rails plugin group.
 To post to this group, send email to activescaff...@googlegroups.com.
 To unsubscribe from this group, send email to 
 activescaffold+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/activescaffold?hl=en.
 
 --
 You received this message because you are subscribed to the Google Groups 
 ActiveScaffold : Ruby on Rails plugin group.
 To post to this group, send email to activescaff...@googlegroups.com.
 To unsubscribe from this group, send email to 
 activescaffold+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/activescaffold?hl=en.
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 ActiveScaffold : Ruby on Rails plugin group.
 To post to this group, send email to activescaff...@googlegroups.com.
 To unsubscribe from this group, send email to 
 activescaffold+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/activescaffold?hl=en.
 

-- 
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Error using MySQL VIEW (undefined method `primary_key' for 2:Fixnum)

2010-05-03 Thread Soren Christensen


I think this is what delegate_to is intended for.

I have used it that way a couple of times with great results.

Alternatively you can also define a bunch of virtual fields that then 
just references the 'other' model.


So assume one is called model_a and the other is model_b

Model_b can then have columns that are defined as:

  def address
self.user.address unless self.user.nil?
  end

/S


On 5/3/2010 4:37 PM, Iñaki Baz Castillo wrote:

Hi, I've two models sharing the same table and have realized about a
possible bug or strange behavior in Rails 2.3:

- In both models I define the same table name (of course):
  def self.table_name() address end

- Then I create a helper for each model/controller, but the methods I
define on one of them are shared by both controllers!


Well, to avoid it I've created a VIEW, with same columns as the
original address table has.
Then I get an error when accessing to the new controller:



ActionView::TemplateError (undefined method `primary_key' for
2:Fixnum) on line #6 of
vendor/plugins/active_scaffold/frontends/default/views/_list_record.html.erb:
3: dont_show_calculations ||= false
4: tr_class = cycle(, even-record)
5: tr_class +=  #{list_row_class(record)} if respond_to?
:list_row_class
6: url_options = params_for(:action =  :list, :id =  record.id)
7: -%
8:
9:tr class=record%= tr_class % id=%= element_row_id(:action
=  :list, :id =  record.id) %

 activerecord (2.3.4) lib/active_record/base.rb:2448:in `id'
 
vendor/plugins/active_scaffold/frontends/default/views/_list_record.html.erb:6
 actionpack (2.3.4) lib/action_view/renderable.rb:34:in `send'
 actionpack (2.3.4) lib/action_view/renderable.rb:34:in
`render_without_active_scaffold'
 actionpack (2.3.4) lib/action_view/base.rb:301:in `with_template'
 actionpack (2.3.4) lib/action_view/renderable.rb:30:in
`render_without_active_scaffold'
 
vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:94:in
`render'
 actionpack (2.3.4) lib/action_view/renderable_partial.rb:20:in
`render'
 actionpack (2.3.4) lib/action_controller/benchmarking.rb:26:in
`benchmark'
 activesupport (2.3.4)
lib/active_support/core_ext/benchmark.rb:17:in `ms'
 /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
 activesupport (2.3.4)
lib/active_support/core_ext/benchmark.rb:17:in `ms'
 actionpack (2.3.4) lib/action_controller/benchmarking.rb:26:in
`benchmark'
 actionpack (2.3.4) lib/action_view/renderable_partial.rb:19:in
`render'
 actionpack (2.3.4) lib/action_view/template.rb:199:in
`render_template'
 actionpack (2.3.4) lib/action_view/renderable_partial.rb:44:in
`render_partial'
 actionpack (2.3.4) lib/action_view/partials.rb:221:in
`render_partial_collection'
 actionpack (2.3.4) lib/action_view/partials.rb:216:in `map'
 actionpack (2.3.4) lib/action_view/partials.rb:216:in
`render_partial_collection'
 actionpack (2.3.4) lib/action_view/partials.rb:182:in
`render_partial'
 actionpack (2.3.4) lib/action_view/base.rb:262:in
`render_without_active_scaffold'
 
vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:61:in
`render'
 vendor/plugins/active_scaffold/frontends/default/views/_list.html.erb:16
 actionpack (2.3.4) lib/action_view/renderable.rb:34:in `send'
 actionpack (2.3.4) lib/action_view/renderable.rb:34:in
`render_without_active_scaffold'
 actionpack (2.3.4) lib/action_view/base.rb:301:in `with_template'
 actionpack (2.3.4) lib/action_view/renderable.rb:30:in
`render_without_active_scaffold'
 
vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:94:in
`render'



Should active_scaffold work ok when using a MySQL VIEW?
Thanks.

   


--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Bug Fix - Calculations

2010-04-14 Thread Soren Christensen

Hi,

I have a calculation defined like this:
config.columns[:num_payments].calculate = :avg

This works just fine except in this one case.

I have previously used the live search to find some records. The search 
is stored in my session.

Next time I come back to this controller the same search will be run.

BUT in the mean time the databases has changed so this search now comes 
up empty.
So the calculation is now being called on an empty list. Which results 
in this error.



   xxxController#index (ActionView::TemplateError) undefined method
   `num_payments' for nil:NilClass

On line #6 of 
vendor/plugins/active_scaffold/frontends/default/views/_list_calculations.html.erb


|
3: % active_scaffold_config.list.columns.each do |column| -%
4: td id=%= active_scaffold_calculations_id(column) if 
column.calculation? %

5: % if column.calculation? -%
6: %= render_column_calculation(column) %
7: % else -%
8: nbsp;|
| 9: % end -%
|

The fix is simply to avoid calling the partial list_calculations when 
@records is empty.
To do so change 
vendor/plugins/active_scaffold/frontends/default/views/_list.html.erb to 
(notice line 18):


table cellpadding=0 cellspacing=0
thead
tr
%= render :partial = 'list_column_headings' %
/tr
/thead
tbody class=messages
tr
td colspan=%= active_scaffold_config.list.columns.length + 1 -% 
class=messages-container

%= render :partial = 'list_messages' %
/td
/tr
/tbody
tbody class=records id=%= active_scaffold_tbody_id %
% if !...@records.empty? -%
%= render :partial = 'list_record', :collection = @page.items, 
:locals = { :hidden = false, :dont_show_calculations = true } %

% end -%
% if active_scaffold_config.list.columns.any? {|c| c.calculation?} and 
!...@records.empty? -%

%= render :partial = 'list_calculations' %
% end -%
/tbody
/table
%= render :partial = 'list_pagination' %

--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Bug in HABTM table manipulations

2010-04-12 Thread Soren Christensen


Exactly,

so when you delete with

DELETE FROM `roles_users` WHERE user_id = 2 AND role_id IN (2,2)

then both entries are deleted, but AS only redraws one of the entries.
Should it now redraw both entries ?

/S

On 4/12/2010 1:18 AM, Sergio Cambra .:: entreCables S.L. ::. wrote:

On Domingo, 11 de Abril de 2010 23:42:01 Soren Christensen escribió:
   

Hi,

Seems that there is a bug in AS.

If you have a HABTM relation where there happens to be multiple
identical entries, then you can not delete one of the copies, but you
have to delete them ALL, update, edit again and then add a single copy
back.

/S
 

It's not possible to delete one of the identical associations.

If you have an user which has and belongs to many roles, the join table will
be roles_users with two fields: role_id and user_id. For example, you have user
with id 1, and two identical associations with the role with id 2. The table
will be:

role_id | user_id

2 | 1
2 | 1

To delete an association you would use the following query:
DELETE FROM `roles_users` WHERE user_id = 2 AND role_id IN (2,2)

But that query will remove both identical associations.

So, you shouldn't have duplicated associations with that table.

   


--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Bug in HABTM table manipulations

2010-04-11 Thread Soren Christensen

Hi,

Seems that there is a bug in AS.

If you have a HABTM relation where there happens to be multiple 
identical entries, then you can not delete one of the copies, but you 
have to delete them ALL, update, edit again and then add a single copy back.


/S

--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



AS destroys YAML format in Text field

2010-04-09 Thread Soren Christensen

Hi,

I have an AS based controller. In some of the Text fields in the 
controller I have YAML formatted strings holding the selection values 
from some checkboxes. The YAML is generated from a Formtastic based 
frontend.
The fields are not based on an a AR association so AS does not 
'understand' what is in the fields.


If I edit the record and edit a NON-YAML field AS will destroy the \n 
characters on the YAML data and thereby render it useless. The standard 
YAML parser will fail to read it in if if does not contain the \n.


AS should never alter the format of the YAML fields!

Is there a way I can prevent AS from destroying the format of those fields.

/S

--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Calling a AS Controller

2010-04-07 Thread Soren Christensen

Hi,

On the embedded scaffolds you can include the conditions  constraints 
to control what AS shows.


Is there a way to 'call' a regular controller such that it will function 
as a embedded controller.

So something like:

redirect_to users_controller_url, :conditions = , :constraints = 
. etc etc



/S

--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



a troublesome search query

2010-04-05 Thread Soren Christensen

Hi,

Have a a class called mg that belongs_to users.

I also have another class called Employer that HABTM to user.

I defined a new virtual column under MG called employer and sets it to
users.employers.name

Would it be better to set it up as a HABTM relation as well ?

I need to be able to add the search and sort to this new employers category.

But adding this is causing me a few problems. What I have simply assumed 
would work throws errors. Can somebody help ?


config.columns[:employers].search_sql = employers.name
config.columns[:employers].sort_by :sql = employers.name
config.live_search.columns  :employers


--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Turning an ID column into links to id.pdf files

2010-04-05 Thread Soren Christensen

Look at a field override that you place in the helper files.

There are some examples on the wiki.

Yes we can!

On Apr 5, 2010, at 15:55, WSzP c...@ctdd.ro wrote:


Hello,
I got an ID column in an ActiveScaffold, that should be a link,
pointing to /somewhere/id.pdf
How can I do that? So basically turning the id into a link.

Currently it looks like this:
class SubscriptionsController  ApplicationController
 active_scaffold :subscriptions do |config|
   config.columns[:id].label = 'Download .pdf'
 end
end

Thanks a lot,
Peter

--  
You received this message because you are subscribed to the Google  
Groups ActiveScaffold : Ruby on Rails plugin group.

To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en 
.




--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: activescaffold.com down

2010-04-04 Thread Soren Christensen


That's over 2 years old !

For rails 2.3.5 I would recommend that you use Master branch.

/S

On 4/4/2010 11:59 AM, JeffS wrote:

This is kind of odd- when I use :type as :member or :collection, the
action link isn't created, but when I use :table, it is created. I'm
running Rails 2.3.5 and AS 1.2RC1.

On Apr 2, 3:34 pm, Soren Christensenso...@silikone.com  wrote:
   

:type is now :member or :collection

/S

On 4/2/2010 10:30 AM, George wrote:

 

I've been unable to contacthttp://activescaffold.comfor about a week
now. Did anything happen to this site?
   
 

Also, ever since we upgraded to v1.2RC1, I've noticed that adding
action links appears to be broken. Here's a code example:
   
 

class Admin::UsersControllerAdmin::BaseController
before_filter :load_user, :only =
[:send_activation_email, :impersonate_user]
# Custom active_scaffold settings (http://activescaffold.com)
active_scaffold :users do |config|
  ...
  config.action_links.add 'send_activation_email',
  :action ='send_activation_email',
  :type =:record,
  :inline =true,
  :position =:after,
  :label ='Re-send Activation'
end
   
   


--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: activescaffold.com down

2010-04-04 Thread Soren Christensen



remove an old installation manually from vendor/plugins and remove the 
public/stylesheets and public/javascript elements as well.


Then do a new install.

and the install the render component.



On 4/4/2010 1:05 PM, JeffS wrote:

Ah, I've been looking at the getting started guide. I just did a --
force install of AS rails-2.3 and now Mongrel throws up a lot of
errors when trying to start. I'll have to work on this.

Thanks!

Jeff

On Apr 4, 3:50 pm, Soren Christensenso...@silikone.com  wrote:
   

That is the right command and you will get master from that command.

Did you read the Readme at the bottom of the github page ?

Please note the following list of Active Scaffold branches and Rails versions. 
Master will not work with Rails2.2

Active Scaffold master currently supports rails-2.3.5, but incompatible changes 
can be introduced, if you want an stable
version, use rails-2.3
Rails 2.3.*: Active Scaffold rails-2.3
Rails 2.2.*: Active Scaffold rails-2.2
Rails 2.1.*: Active Scaffold rails-2.1
Rails2.1: Active Scaffold 1-1-stable (no guarantees)

Since Rails 2.3, render_component plugin is needed for nested and embbeded 
scaffolds. It works with rails-2.3 branch
from ewildgoose repository:
script/plugin install git://github.com/ewildgoose/render_component.git -r 
rails-2.3

/S

On 4/4/2010 12:37 PM, JeffS wrote:

 

Yes, I am reading about git now to figure out how to install Master.
If the command is just
   
 

./script/plugin install git://github.com/activescaffold/active_scaffold.git
   
 

Then I am, in fact, using Master and I was mistaken.
   
 

Thanks,
   
 

Jeff
   
 

On Apr 4, 3:06 pm, Soren Christensenso...@silikone.comwrote:
   
 

That's over 2 years old !
 
 

For rails 2.3.5 I would recommend that you use Master branch.
 
 

/S
 
 

On 4/4/2010 11:59 AM, JeffS wrote:
 
 

This is kind of odd- when I use :type as :member or :collection, the
action link isn't created, but when I use :table, it is created. I'm
running Rails 2.3.5 and AS 1.2RC1.
   
 

On Apr 2, 3:34 pm, Soren Christensenso...@silikone.com  wrote:
   
 

:type is now :member or :collection
 
 

/S
 
 

On 4/2/2010 10:30 AM, George wrote:
 
 

I've been unable to contacthttp://activescaffold.comforabouta week
now. Did anything happen to this site?
   
 

Also, ever since we upgraded to v1.2RC1, I've noticed that adding
action links appears to be broken. Here's a code example:
   
 

class Admin::UsersControllerAdmin::BaseController
  before_filter :load_user, :only =
[:send_activation_email, :impersonate_user]
  # Custom active_scaffold settings (http://activescaffold.com)
  active_scaffold :users do |config|
...
config.action_links.add 'send_activation_email',
:action ='send_activation_email',
:type =:record,
:inline =true,
:position =:after,
:label ='Re-send Activation'
end
   
   


--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: activescaffold.com down

2010-04-02 Thread Soren Christensen


:type is now :member or :collection

/S


On 4/2/2010 10:30 AM, George wrote:

I've been unable to contact http://activescaffold.com for about a week
now. Did anything happen to this site?

Also, ever since we upgraded to v1.2RC1, I've noticed that adding
action links appears to be broken. Here's a code example:

class Admin::UsersController  Admin::BaseController
   before_filter :load_user, :only =
[:send_activation_email, :impersonate_user]
   # Custom active_scaffold settings (http://activescaffold.com)
   active_scaffold :users do |config|
 ...
 config.action_links.add 'send_activation_email',
 :action =  'send_activation_email',
 :type =  :record,
 :inline =  true,
 :position =  :after,
 :label =  'Re-send Activation'
end

   


--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: TinyMCE

2010-04-01 Thread Soren Christensen


That was what was missing !

I seem to be unable to get options and html_options to resize the text 
input window.


config.columns[:content].form_ui = :text_editor
config.columns[:content].options = {:html_options = [[:rows, 
'30'], [:cols, '50']]}


What is the right way to control the size of the input field ?

/S

On 3/31/2010 1:06 AM, Sergio Cambra .:: entreCables S.L. ::. wrote:

On Martes, 30 de Marzo de 2010 23:09:43 Soren Christensen escribió:
   

Hi,

Is there some special magic required to get TinyMCE to work for editing
a TEXT field inside of an AS edit page ?

Set the form_ui to :text_editor and install TinyMCE under plugins.

But this does not seem to do anything in my case.

/S
 

Have you put in your controller uses_tiny_mce? It's required to
automatically include tiny_mce.js and call tinyMCE.init

   


--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



TinyMCE

2010-03-30 Thread Soren Christensen

Hi,

Is there some special magic required to get TinyMCE to work for editing 
a TEXT field inside of an AS edit page ?


Set the form_ui to :text_editor and install TinyMCE under plugins.

But this does not seem to do anything in my case.

/S

--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



private method `gsub' called

2010-03-29 Thread Soren Christensen


Hi,

The new version of as throws this error when it is evaluating this 
helper method.
#NoMethodError: private method `gsub' called for 
#Hash:0x2ae14c6456d8 -- on the ActiveScaffold column = :tetanus in 
StudentsController



  # Code to set the range of years supported for Tetanus shots.
  def tetanus_form_column(record, input_name)
date_select :record, :tetanus,
  :include_blank = true,
  :name = input_name,
  :start_year = Date.today.year-15,
  :end_year = Date.today.year
  end

Do I need to update something or did an error sneak into the latest 
version of AS ?


/S

--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Adding members to a HABTM

2010-03-22 Thread Soren Christensen

Hi,

I have a group model where users can be members of - all build using a 
HABTM model.


When I edit a group I would like my admin view to be able to add 
particular users to a group, but the update view of the group only shows 
the UI for adding a new user, not for selecting an existing user from 
the database.


Is there something that I need to do to get this functionality in HABTM 
or does this only work for belongs_to associations ?


/S

--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Did the search config change

2010-03-19 Thread Soren Christensen


The table field might actually be the better of those proposals since it 
would completely eliminate any kind of SQL specificness in the higher 
layers.


/S

On 3/19/2010 2:11 AM, Sergio Cambra .:: entreCables S.L. ::. wrote:

On Jueves, 18 de Marzo de 2010 20:29:24 Soren Christensen escribió:
   

Sergio,

How about an enhancement to this syntax ?
Lets define the syntax to be one of them - say MySQL - don't really care
which, but if the adaptor is not that particular syntax the search code
will rewrite the query to the right syntax.
I have MySQL in Dev and host on Heroku which uses PostGreSQL - so this
is a real pain.
 

It accepts SQL for flexibility, you can use standard SQL where is possible to
avoid it, or use postgresql in development. Also you can add a field to your
table instead of using CONCAT, then you can add a index to search which is
faster.

I don't want to add db specific code to AS, and I think ActiveRecord adapters
has no method to build concat operation.

   

ActiveRecord::Base.connection.class

=  ActiveRecord::ConnectionAdapters::PostgreSQLAdapter

For the Concat operation:
Oracle uses '|', postgres uses '||' and MySQL  SQL server uses '+'.

/S

On 3/18/2010 12:02 PM, Soren Christensen wrote:
 

There needs to be some documentation for the
 config.actions.swap :search, :live_search

Which is required to get the live search to work

Shall I just add it to the Wiki ?

/S

On 3/18/2010 9:51 AM, Soren Christensen wrote:
   

Hi,

I have a lot of various associated tables - but the search seems to
be broken in them  - did the config for search change ?

I have:

 # Add search to the user column
 config.columns[:user].search_sql = CONCAT(users.first_name, ' ',
users.last_name)
 config.columns[:user].sort_by :sql =  CONCAT(users.first_name, '
', users.last_name)

Where user is a belongs_to column in my database.

Did I miss something ?
The log shows that what I search for is being search for in the
database, but ONLY in the native columns.

/S
 
   


--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Did the search config change

2010-03-18 Thread Soren Christensen
No! it works just fine - but it works really well if you add the columns 
to the search functions.


So either
config.live_search.columns  :user
or
config.search.columns  :user

/S


On 3/18/2010 9:51 AM, Soren Christensen wrote:

Hi,

I have a lot of various associated tables - but the search seems to be 
broken in them  - did the config for search change ?


I have:

# Add search to the user column
config.columns[:user].search_sql = CONCAT(users.first_name, ' ', 
users.last_name)
config.columns[:user].sort_by :sql = CONCAT(users.first_name, ' 
', users.last_name)


Where user is a belongs_to column in my database.

Did I miss something ?
The log shows that what I search for is being search for in the 
database, but ONLY in the native columns.


/S



--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Did the search config change

2010-03-18 Thread Soren Christensen


There needs to be some documentation for the
config.actions.swap :search, :live_search

Which is required to get the live search to work

Shall I just add it to the Wiki ?

/S


On 3/18/2010 9:51 AM, Soren Christensen wrote:

Hi,

I have a lot of various associated tables - but the search seems to be 
broken in them  - did the config for search change ?


I have:

# Add search to the user column
config.columns[:user].search_sql = CONCAT(users.first_name, ' ', 
users.last_name)
config.columns[:user].sort_by :sql = CONCAT(users.first_name, ' 
', users.last_name)


Where user is a belongs_to column in my database.

Did I miss something ?
The log shows that what I search for is being search for in the 
database, but ONLY in the native columns.


/S



--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Did the search config change

2010-03-18 Thread Soren Christensen


Sergio,

How about an enhancement to this syntax ?
Lets define the syntax to be one of them - say MySQL - don't really care 
which, but if the adaptor is not that particular syntax the search code 
will rewrite the query to the right syntax.
I have MySQL in Dev and host on Heroku which uses PostGreSQL - so this 
is a real pain.


 ActiveRecord::Base.connection.class
= ActiveRecord::ConnectionAdapters::PostgreSQLAdapter

For the Concat operation:
Oracle uses '|', postgres uses '||' and MySQL  SQL server uses '+'.

/S

On 3/18/2010 12:02 PM, Soren Christensen wrote:


There needs to be some documentation for the
config.actions.swap :search, :live_search

Which is required to get the live search to work

Shall I just add it to the Wiki ?

/S


On 3/18/2010 9:51 AM, Soren Christensen wrote:

Hi,

I have a lot of various associated tables - but the search seems to 
be broken in them  - did the config for search change ?


I have:

# Add search to the user column
config.columns[:user].search_sql = CONCAT(users.first_name, ' ', 
users.last_name)
config.columns[:user].sort_by :sql = CONCAT(users.first_name, ' 
', users.last_name)


Where user is a belongs_to column in my database.

Did I miss something ?
The log shows that what I search for is being search for in the 
database, but ONLY in the native columns.


/S





--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Data Exporting - NOW WORKS IN 2.3.5 on MASTER

2010-03-17 Thread Soren Christensen


And if you are on Master then the :table/:record notations is now 
replaced with :collection/:member


So the AS_export code needs to be patched one more place to work on master.
in active_scaffold_export/lib/active_scaffold/config/export.rb
replace:
@@link = 
ActiveScaffold::DataStructures::ActionLink.new('show_export', :label = 
'Export', :type = :table, :security_method = :export_authorized?)

with:
@@link = 
ActiveScaffold::DataStructures::ActionLink.new('show_export', :label = 
'Export', :type = :collection, :security_method = :export_authorized?)


With both patches I have AS_Export working again with the latest AS from 
the Master branch.


Patch format:
index c29ac87..2e8dc65 100755
@@ -10,7 +10,8 @@ module ActiveScaffold::Config
 # --
 # the ActionLink for this action
 cattr_accessor :link
-@@link = 
ActiveScaffold::DataStructures::ActionLink.new('show_export', :label = 
'Export', :type = :table, :security_method = :export_authorized?)
+@@link = 
ActiveScaffold::DataStructures::ActionLink.new('show_export', :label = 
'Export', :type = :collection, :security_method = :export_authorized?)


 # configures where the plugin itself is located. there is no 
instance version of this.

 cattr_accessor :plugin_directory

/S


On 3/17/2010 10:38 AM, Nick Rogers wrote:

Looks like the active_scaffold_joins method was deprecated:

def active_scaffold_includes
  if respond_to? :active_scaffold_joins
::ActiveSupport::Deprecation.warn(You have defined 
active_scaffold_joins, but it's deprecated because it's confusing, you 
should use active_scaffold_includes now, caller)

return active_scaffold_joins
  end
  @active_scaffold_includes ||= []
end

You can easily fix the active_scaffold_export plugin by changing the 
one call to active_scaffold_joins to call active_scaffold_includes 
instead.


Can someone push this change to the ewildmoss active_scaffold_export?

Index: lib/active_scaffold/actions/export.rb
===
--- lib/active_scaffold/actions/export.rb
+++ lib/active_scaffold/actions/export.rb
@@ -61,7 +61,7 @@
   export_columns = export_config.columns.reject { |col| 
params[:export_columns][col.name.to_sym].nil? }
   includes_for_export_columns = export_columns.collect{ |col| 
col.includes }.flatten.uniq.compact

-  self.active_scaffold_joins.concat includes_for_export_columns
+  self.active_scaffold_includes.concat includes_for_export_columns
   find_options = { :sorting = 
active_scaffold_config.list.user.sorting }

   params[:search] = session[:search]



On Wed, Mar 17, 2010 at 10:28 AM, Nick Rogers ncrog...@gmail.com 
mailto:ncrog...@gmail.com wrote:


I just upgraded to latest rails-2.3 branch (I was about two months
behind) and my export is broken now too.

I get an undefined method `active_scaffold_joins' ... exception
when clicking on the Update button in the export form.


On Tue, Mar 16, 2010 at 12:35 AM, Soren Christensen
so...@silikone.com mailto:so...@silikone.com wrote:


Interesting - will check that again tomorrow.

All I got today was that my exports was removed !

/S



On 3/15/2010 9:05 PM, Nick Rogers wrote:


Third! But FWIW the ewildgoose version has been working for
me on a relatively-recent checkout of active_scaffold + rails
2.3.5.

On Mon, Mar 15, 2010 at 8:14 PM, Ray Parker
rayparkerbasspla...@gmail.com
mailto:rayparkerbasspla...@gmail.com wrote:

2nd.

-- 
You received this message because you are subscribed to the

Google Groups ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to
activescaffold@googlegroups.com
mailto:activescaffold@googlegroups.com.
To unsubscribe from this group, send email to
activescaffold+unsubscr...@googlegroups.com
mailto:activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.


-- 
You received this message because you are subscribed to the

Google Groups ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to
activescaffold@googlegroups.com
mailto:activescaffold@googlegroups.com.
To unsubscribe from this group, send email to
activescaffold+unsubscr...@googlegroups.com
mailto:activescaffold%2bunsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.



--
You received this message because you are subscribed to the Google 
Groups ActiveScaffold : Ruby on Rails plugin group.

To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email

Re: Data Exporting

2010-03-15 Thread Soren Christensen


Sergio,

Can you outline what needs to be done to get AS Export moved forward.

I need it badly and have broken functionality relating to the joins 
problem here - so I'll try to find the time to fix it.


/S

On 3/11/2010 12:17 AM, Sergio Cambra .:: entreCables S.L. ::. wrote:

On Jueves, 11 de Marzo de 2010 04:30:05 jopher91 escribió:
   

I've been working on this just today, and had had some problems
(including the active_scaffold_joins error above) but when I just
tried to get a fresh start, and got the most recent versions of both
active_scaffold and active_scaffold_export, I get a new surprise:  the
export link at the top of the table doesn't appear at all!  (My
controller code hasn't changed: still has the
config.actions.add :export line which enabled it the first time.
Anybody else see this?
 

Are you using master branch or rails-2.3 branch of AS? I sent a mail about the
new rails-2.3 branch, which will be stable. I have removed support for
deprecate code in master branch and maybe some plugins won't work until they
will be updated for master branch.

Here, ActiveScaffoldExport works with rails-2.3 branch, with master branch I
don't get the export link.

   

On Mar 10, 3:19 pm, Ray Parkerrayparkerbasspla...@gmail.com  wrote:
 

Put something like this in your controller:

  def active_scaffold_joins
 @active_scaffold_joins ||= [:address_state,
 :address_country,
 :mailing_region,
 :language]
   end

On Mar 10, 2:55 pm, Ray Parkerrayparkerbasspla...@gmail.com  wrote:
   

That looks like exactly what I need -- thanks!

Getting this error when I hit the Export button, even on the simplest
of tables:

undefined method `active_scaffold_joins' for 

I've just begun on this and will keep you all up to date when I figure
it out.

On Mar 10, 5:23 am, Sergio Cambra .:: entreCables S.L. ::.

ser...@entrecables.com  wrote:
 

On Martes, 9 de Marzo de 2010 00:56:59 Ray Parker escribió:
   

How are people approachng this?  I would like to be able to export,
hopefully to a builder or builder-type apparatus, filtered lists
and the like.  I tried to get the ActiveDataExport plugin to work
only to find that it hasn't been maintained in years.  (Someone
might update ActiveScaffold.com)

Thanks ahead in advance!
 

Have you tried ActiveScaffoldExport from
ewildgoose?http://github.com/ewildgoose/active_scaffold_export

--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com
   
   


--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Data Exporting

2010-03-15 Thread Soren Christensen


Actually - would also like to nominate Export to be a core feature of AS.

Anyone to second that ?

/S


On 3/15/2010 11:50 AM, Soren Christensen wrote:


Sergio,

Can you outline what needs to be done to get AS Export moved forward.

I need it badly and have broken functionality relating to the joins 
problem here - so I'll try to find the time to fix it.


/S

On 3/11/2010 12:17 AM, Sergio Cambra .:: entreCables S.L. ::. wrote:

On Jueves, 11 de Marzo de 2010 04:30:05 jopher91 escribió:

I've been working on this just today, and had had some problems
(including the active_scaffold_joins error above) but when I just
tried to get a fresh start, and got the most recent versions of both
active_scaffold and active_scaffold_export, I get a new surprise:  the
export link at the top of the table doesn't appear at all!  (My
controller code hasn't changed: still has the
config.actions.add :export line which enabled it the first time.
Anybody else see this?
Are you using master branch or rails-2.3 branch of AS? I sent a mail 
about the

new rails-2.3 branch, which will be stable. I have removed support for
deprecate code in master branch and maybe some plugins won't work 
until they

will be updated for master branch.

Here, ActiveScaffoldExport works with rails-2.3 branch, with master 
branch I

don't get the export link.


On Mar 10, 3:19 pm, Ray Parkerrayparkerbasspla...@gmail.com  wrote:

Put something like this in your controller:

  def active_scaffold_joins
 @active_scaffold_joins ||= [:address_state,
 :address_country,
 :mailing_region,
 :language]
   end

On Mar 10, 2:55 pm, Ray Parkerrayparkerbasspla...@gmail.com  wrote:

That looks like exactly what I need -- thanks!

Getting this error when I hit the Export button, even on the simplest
of tables:

undefined method `active_scaffold_joins' for 

I've just begun on this and will keep you all up to date when I 
figure

it out.

On Mar 10, 5:23 am, Sergio Cambra .:: entreCables S.L. ::.

ser...@entrecables.com  wrote:

On Martes, 9 de Marzo de 2010 00:56:59 Ray Parker escribió:

How are people approachng this?  I would like to be able to export,
hopefully to a builder or builder-type apparatus, filtered lists
and the like.  I tried to get the ActiveDataExport plugin to work
only to find that it hasn't been maintained in years.  (Someone
might update ActiveScaffold.com)

Thanks ahead in advance!

Have you tried ActiveScaffoldExport from
ewildgoose?http://github.com/ewildgoose/active_scaffold_export

--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com




--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Master/HEAD = Routing Error

2010-03-15 Thread Soren Christensen


Hi

Updated to Master Branch and latest checkin to get my Join capabilities 
back.

Now I'm short my export capabilities - but only for a short time.

I have an action_link action that uses the update_row JS action to 
repaint the part of the table that was modified by this action.


The function works and does it thing, but it causes a routing  error in 
the log, and nothing gets repainted in the UI.

Any insights ?

The validated method stripped down:
  def validated
@record = beginning_of_chain.find(params[:id])
.
respond_to do |format|
  format.html { redirect_to :action = :index }
  format.js { render :action = 'update_row' }
end

  end


Processing DonationsController#validated (for 192.168.0.209 at 
2010-03-16 00:03:

39) [GET]
  Parameters: {action=validated, _method=get, 
adapter=_list_inline

_adapter, id=398, controller=donations}
  ^[[4;35;1mUser Load (0.3ms)^[[0m   ^[[0mSELECT * FROM `users` WHERE 
(`users`.`

id` = 2) LIMIT 1^[[0m
  ^[[4;36;1mDonation Load (0.1ms)^[[0m   ^[[0;1mSELECT * FROM 
`donations` WHERE

(`donations`.`id` = 398) ^[[0m
  ^[[4;35;1mCACHE (0.0ms)^[[0m   ^[[0mSELECT * FROM `donations` WHERE 
(`donation

s`.`id` = 398) ^[[0m
  ^[[4;36;1mPayment Load (0.4ms)^[[0m   ^[[0;1mSELECT * FROM `payments` 
WHERE (`

payments`.donation_id = 398) ^[[0m
  ^[[4;35;1mInstallment Load (0.1ms)^[[0m   ^[[0mSELECT * FROM 
`installments` WH

ERE (`installments`.donation_id = 398) ^[[0m
  ^[[4;36;1mSQL (0.0ms)^[[0m   ^[[0;1mBEGIN^[[0m
  ^[[4;35;1mSQL (0.0ms)^[[0m   ^[[0mCOMMIT^[[0m
  ^[[4;36;1mUser Load (0.2ms)^[[0m   ^[[0;1mSELECT * FROM `users` WHERE 
(`users`

.`id` = 3) ^[[0m
  ^[[4;35;1mCampaign Load (0.1ms)^[[0m   ^[[0mSELECT * FROM `campaigns` 
WHERE (`

campaigns`.`id` = 1) ^[[0m
  ^[[4;36;1mCACHE (0.0ms)^[[0m   ^[[0;1mSELECT * FROM `users` WHERE 
(`users`.`id

` = 3) ^[[0m
  ^[[4;35;1mCACHE (0.0ms)^[[0m   ^[[0mSELECT * FROM `campaigns` WHERE 
(`campaign

s`.`id` = 1) ^[[0m
removed email output 
Rendering update_row  
  ^[[4;36;1mMatchingGrant Columns (0.7ms)^[[0m   ^[[0;1mSHOW FIELDS 
FROM `matching_grants`^[[0m
  ^[[4;35;1mSQL (0.2ms)^[[0m   ^[[0mSELECT count(*) AS count_all FROM 
`matching_grants` WHERE (`matching_grants`.donation_id = 398) ^[[0m
  ^[[4;36;1mMatchingGrant Load (0.1ms)^[[0m   ^[[0;1mSELECT * FROM 
`matching_grants` WHERE (`matching_grants`.donation_id = 398) LIMIT 4^[[0m
  ^[[4;35;1mInstallment Columns (0.6ms)^[[0m   ^[[0mSHOW FIELDS FROM 
`installments`^[[0m
  ^[[4;36;1mSQL (0.1ms)^[[0m   ^[[0;1mSELECT count(*) AS count_all FROM 
`installments` WHERE (`installments`.donation_id = 398) ^[[0m
  ^[[4;35;1mPayment Columns (0.7ms)^[[0m   ^[[0mSHOW FIELDS FROM 
`payments`^[[0m
  ^[[4;36;1mSQL (0.3ms)^[[0m   ^[[0;1mSELECT count(*) AS count_all FROM 
`payments` WHERE (`payments`.donation_id = 398) ^[[0m
  ^[[4;35;1mCACHE (0.0ms)^[[0m   ^[[0mSELECT * FROM `users` WHERE 
(`users`.`id` = 3) ^[[0m

Rendered _list_record_columns (17.5ms)
Rendered _list_actions (6.1ms)
  ^[[4;36;1mSQL (0.2ms)^[[0m   ^[[0;1mSELECT sum(`donations`.amount) AS 
sum_amount FROM `donations` ^[[0m

Rendered _list_calculations (3.6ms)
Rendered _list_record (41.7ms)
Rendered _messages (1.0ms)
Rendered _list_inline_adapter (153.6ms)
Completed in 30378ms (View: 157, DB: 0) | 200 OK 
[http://scs.silikone.com/donations/validated/398?_method=getadapter=_list_inline_adapter]

  ^[[4;35;1mSQL (0.1ms)^[[0m   ^[[0mSET SQL_AUTO_IS_NULL=0^[[0m
  ^[[4;36;1mUser Columns (2.5ms)^[[0m   ^[[0;1mSHOW FIELDS FROM 
`users`^[[0m


Processing ApplicationController#index (for 192.168.0.209 at 2010-03-16 
00:04:11

) [GET]
  Parameters: {1268695047\\\=nil}

ActionController::RoutingError (No route matches 
/\/images/active_scaffold/default/indicator.gif with {:method=:get}):
  passenger (2.2.9) lib/phusion_passenger/rack/request_handler.rb:92:in 
`process_request'
  passenger (2.2.9) 
lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
  passenger (2.2.9) 
lib/phusion_passenger/railz/application_spawner.rb:400:in 
`start_request_handler'





--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Refreshing Index list after a per record action

2010-03-11 Thread Soren Christensen

Hi,

I have a controller that has AS installed and I have added an extra 
action to the actions with this:


config.action_links.add Confirm,
 :controller = donations,
 :action = validated,
 :label = CHKd,
 :type = :record,
 :page = false

All works fine - but when my code is done the index page is not 
refreshed (I end with a redirect_to :action = :index) - So is there 
some magic that I can call to get an AJAX refresh of just the line that 
was changed ?


Also - I saw somebody posted how to put an image into an action link's 
icon - just can not find it again - How was that done ?


/S

--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: redirection after an AS action

2010-02-24 Thread Soren Christensen

Nice !

 def create_respond_to_html
if successful?
  render :inline =  '%= javascript_tag window.close() %'
else
  super
end
  end


obviously delete and the other standard actions works too.

But what about Cancel ?

That would send the user to the index function - can we capture that one 
somehow ?


/S


On 2/23/2010 3:43 AM, Sergio Cambra .:: entreCables S.L. ::. wrote:

On Martes, 23 de Febrero de 2010 10:10:46 Soren Christensen escribió:
   

My creates are regular AS creates. Do I need to do something specific to
change the default behavior ?
 

Sorry, I was wrong, I forgot when you load the page without XHR, the form will
be sent as http request, without XHR. So the response will be an html
response, and you will have to override create_respond_to_html:
   def create_respond_to_html
 if successful?
   render :inline =  '%= javascript_tag window.close() %'
 else
   super
 end
   end


   

/S

On 2/22/2010 11:46 PM, mrbana...@googlemail.com wrote:
 

Nothing happens means... 1. create is triggered, but not your
on_create.js.rjs. or 2. even create is not triggered.

For option 1 I would check if your create form is triggering a
normal html request and not an ajax request.

--
Volker

On 22 Feb., 22:20, Soren Christensenso...@silikone.com   wrote:
   

I'm sure that I'm overlooking something:

Here is how I create the popup:
%= link_to image_tag(/images/icons/add.png, :alt =   Add)+ Add New
Employer, new_employer_path,  :popup =   Konfig::POPTIONS2  %

and in views/employers/on_create.js.rjs I have:
page   'window.close()'

But nothing happens - I don't even see the rjs file in the log.

/S

Sergio Cambra .:: entreCables S.L. ::. wrote:
 

On S�bado, 20 de Febrero de 2010 03:21:50 Soren Christensen escribi�:
   

Hi,


Does anybody know if one can redirect to another action after one has
say created a new record ?
 

You can override action_respond_to_format (for example,
update_respond_to_html). If you want to redirect to edit, use
config.create.edit_after_create = true

   

One level up. I have a screen where a user can create a new employer.
The create link is build with AS so when clicked the user is taken to
an AS create screen in a new popup.


Now once the create action is completed I would like to just destroy
the window and return to the previous window. Any hints on how to do
this ?
 

You have to override on_create.js.rjs view and add there some
javascript code (page   'window.close()' should be enough).
   
   


--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: redirection after an AS action

2010-02-24 Thread Soren Christensen


Ok,

So I'm being picky here - can I get the regular create form and include 
the special action for the create ?


Or do I have to copy the create.html.erb from 
vendor/plugins/active_scaffold/frontends/default/views/

and then add Sergio's code to this ?

script type=text/javascript
$$(#%= element_form_id(:action =  :create) %
a.cancel).first().observe('click', function() { window.close(); });
/script


/S

On 2/24/2010 12:40 AM, Sergio Cambra .:: entreCables S.L. ::. wrote:

On Miércoles, 24 de Febrero de 2010 09:15:16 Soren Christensen escribió:
   

Nice !

   def create_respond_to_html
  if successful?
render :inline =   '%= javascript_tag window.close() %'
  else
super
  end
end
 

You can override create.html.erb and add some javascript to change cancel
link:
script type=text/javascript
$$(#%= element_form_id(:action =  :create) %
a.cancel).first().observe('click', function() { window.close(); });
/script

   


obviously delete and the other standard actions works too.

But what about Cancel ?

That would send the user to the index function - can we capture that one
somehow ?

/S

On 2/23/2010 3:43 AM, Sergio Cambra .:: entreCables S.L. ::. wrote:
 

On Martes, 23 de Febrero de 2010 10:10:46 Soren Christensen escribió:
   

My creates are regular AS creates. Do I need to do something specific to
change the default behavior ?
 

Sorry, I was wrong, I forgot when you load the page without XHR, the form
will be sent as http request, without XHR. So the response will be an
html response, and you will have to override create_respond_to_html:
def create_respond_to_html
  if successful?
render :inline =   '%= javascript_tag window.close() %'
  else
super
  end
end

   

/S

On 2/22/2010 11:46 PM, mrbana...@googlemail.com wrote:
 

Nothing happens means... 1. create is triggered, but not your
on_create.js.rjs. or 2. even create is not triggered.

For option 1 I would check if your create form is triggering a
normal html request and not an ajax request.

--
Volker

On 22 Feb., 22:20, Soren Christensenso...@silikone.comwrote:
   

I'm sure that I'm overlooking something:

Here is how I create the popup:
%= link_to image_tag(/images/icons/add.png, :alt =Add)+ Add
New Employer, new_employer_path,  :popup =Konfig::POPTIONS2  %

and in views/employers/on_create.js.rjs I have:
page'window.close()'

But nothing happens - I don't even see the rjs file in the log.

/S

Sergio Cambra .:: entreCables S.L. ::. wrote:
 

On S�bado, 20 de Febrero de 2010 03:21:50 Soren Christensen escribi�:
   

Hi,


Does anybody know if one can redirect to another action after one
has say created a new record ?
 

You can override action_respond_to_format (for example,
update_respond_to_html). If you want to redirect to edit, use
config.create.edit_after_create = true

   

One level up. I have a screen where a user can create a new
employer. The create link is build with AS so when clicked the user
is taken to an AS create screen in a new popup.


Now once the create action is completed I would like to just destroy
the window and return to the previous window. Any hints on how to do
this ?
 

You have to override on_create.js.rjs view and add there some
javascript code (page'window.close()' should be enough).
   
   


--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: redirection after an AS action

2010-02-23 Thread Soren Christensen



My creates are regular AS creates. Do I need to do something specific to 
change the default behavior ?


/S


On 2/22/2010 11:46 PM, mrbana...@googlemail.com wrote:

Nothing happens means... 1. create is triggered, but not your
on_create.js.rjs. or 2. even create is not triggered.

For option 1 I would check if your create form is triggering a
normal html request and not an ajax request.

--
Volker

On 22 Feb., 22:20, Soren Christensenso...@silikone.com  wrote:
   

I'm sure that I'm overlooking something:

Here is how I create the popup:
%= link_to image_tag(/images/icons/add.png, :alt =  Add)+ Add New
Employer, new_employer_path,  :popup =  Konfig::POPTIONS2  %

and in views/employers/on_create.js.rjs I have:
page  'window.close()'

But nothing happens - I don't even see the rjs file in the log.

/S

Sergio Cambra .:: entreCables S.L. ::. wrote:

 

On S�bado, 20 de Febrero de 2010 03:21:50 Soren Christensen escribi�:
   
 

Hi,
 
 

Does anybody know if one can redirect to another action after one has
say created a new record ?
 
 

You can override action_respond_to_format (for example,
update_respond_to_html). If you want to redirect to edit, use
config.create.edit_after_create = true
   
 

One level up. I have a screen where a user can create a new employer.
The create link is build with AS so when clicked the user is taken to an
AS create screen in a new popup.
 
 

Now once the create action is completed I would like to just destroy the
window and return to the previous window. Any hints on how to do this ?
 
 

You have to override on_create.js.rjs view and add there some javascript code
(page  'window.close()' should be enough).
   
   


--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: redirection after an AS action

2010-02-23 Thread Soren Christensen


Excellent !

So in my case the use can click a create link, a pop-up appears and they 
can create a new element.
Can I use a Javascript command like below to cause the parent of the 
pop-up to reload the element or

do I need to do something like chaining form fields ?

yes - this really ought to be ajax based - later.

/S

On 2/23/2010 3:43 AM, Sergio Cambra .:: entreCables S.L. ::. wrote:

   def create_respond_to_html
 if successful?
   render :inline =  '%= javascript_tag window.close() %'
 else
   super
 end
   end
   


--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



HABTM - dilemma

2010-02-23 Thread Soren Christensen


Hi,

Have a bit of a dilemma here.

Primary key is not allowed in a has_and_belongs_to_many join table is 
the error message that you get if you do have ID and primary keys 
identified in a HABTM table.


But if I take them out then I can not manipulate the table with the 
regular AS tools. (or at least I had problems if I did so).


What is the right way to have HABTM tables that can be manipulated by AS ?

/S

--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: redirection after an AS action

2010-02-22 Thread Soren Christensen


I'm sure that I'm overlooking something:

Here is how I create the popup:
%= link_to image_tag(/images/icons/add.png, :alt = Add)+ Add New 
Employer, new_employer_path,  :popup = Konfig::POPTIONS2  %


and in views/employers/on_create.js.rjs I have:
page  'window.close()'

But nothing happens - I don't even see the rjs file in the log.

/S


Sergio Cambra .:: entreCables S.L. ::. wrote:

On Sábado, 20 de Febrero de 2010 03:21:50 Soren Christensen escribió:
  

Hi,

Does anybody know if one can redirect to another action after one has
say created a new record ?



You can override action_respond_to_format (for example, 
update_respond_to_html). If you want to redirect to edit, use 
config.create.edit_after_create = true


  

One level up. I have a screen where a user can create a new employer.
The create link is build with AS so when clicked the user is taken to an
AS create screen in a new popup.

Now once the create action is completed I would like to just destroy the
window and return to the previous window. Any hints on how to do this ?



You have to override on_create.js.rjs view and add there some javascript code 
(page  'window.close()' should be enough).



  


--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: Calculated Default Values for Forms

2010-02-19 Thread Soren Christensen


You can use do_new to do what you are asking, assuming that this is 
something that happens when you create a new assignment.


It goes like this and is placed in the controller file. You can assign 
defaults to every element in your models, prior to  the elements being 
displayed by AS.

So calculated fields could look like:
 @record.show_date = Date.today + 1.month


 def do_new
   @record = active_scaffold_config.model.new

   @record.user_id = current_user.id

   @record.last_name = current_user.last_name
   @record.address = current_user.address
   @record.city = current_user.city
   @record.zip = current_user.zip
   @record.home_phone = current_user.home_phone

   @record
 end

/S



CoolAJ86 wrote:

I have an assignments model which has a show date, due date, and show
until date.

The show date by default should be today
The due date by default should be 1 week from today
The show until date by default should be 2 weeks from today

Is there a way for me to implement this in ActiveScaffold?

Is there a way for me to implement this from Rails so that it appears
as I want in ActiveScaffold?

AJ ONeal

  


--
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.



Re: What causes the undefined method `create' for # (NoMethodError)

2010-02-04 Thread Soren Christensen

Sure:

class SchoolClass  ActiveRecord::Base

 has_many :accounts

 has_many :funds

 has_many :mailings

 has_many :students

 has_many :teachers,
   :class_name = Staff,
   :conditions = staffs.role = 'teacher'

 has_many :ias,
   :class_name = Staff,
   :conditions = staffs.role = 'ia'

 has_and_belongs_to_many :contacts,
   :class_name = User

/S



Kenneth Ortmann wrote:

Yes you use the singular form of the word(which is the name of the model).

Care to show the associations in your model class?

On Thu, Feb 4, 2010 at 10:52 AM, Soren so...@silikone.com 
mailto:so...@silikone.com wrote:



I built a simple index method after I removed AS.

def index
 @users = User.find(:all)
end

And build a view that just lists a bunch of fields. I made sure to
list all associated fields to see if any of there had problems. None
did.
I could actually take all of the associations that I had to remove in
order to get AS to somewhat function and put them back in.

I the replaced AS back in the controller (and removed the index
method)
I added a very simple AS config back in there:

active_scaffold :user

(you write user, but it is the singular form of the model that goes in
here right ?)

After this addition AS was trying to look for some users based on
users.user_id which obviously threw an SQL error.
So look like I need to hunt for something in the associations that
causes AS to make the invalid assumption that users are referenced by
user_id and not just by id.

Adding a structure like:
active_scaffold :user do |config|
 config.column = [...]
end

caused the error to go away. So it must be something with one of the
fields.

Any good insights to how to find the fields that are causing this ?

/S

On Feb 2, 2:15 pm, Kenneth Ortmann kenny.ortm...@gmail.com
mailto:kenny.ortm...@gmail.com wrote:
 I'm not sure what you mean.

 So if you just put active_scaffold :users in the controller it
breaks?

 On Tue, Feb 2, 2010 at 4:08 PM, Soren Christensen
so...@silikone.com mailto:so...@silikone.comwrote:

   Just quickly toss all references into a braindead index page.

  Works just fine. All associations loads correctly.

  Looks a lot like an AS problem to me.

  BTW Is there a method like inspect that lists all associations
as well ?
  /S

  Soren Christensen wrote:

  Good suggestion !

  Results:

  After removing the AS config section, the route and adding a
new index
  method to the controller and a index view the controller LOADS
AND DISPLAYS
  after a server restart.

  Before we conclude that this is indeed an AS problem the index
page really
  ought to test out every association as well.
  Right now it does not - but it will in a couple of hours. More
later.

  /S

  Kenneth Ortmann wrote:

  What I would do is comment out everything in the
UsersController that is
  for active scaffold.

  I would try to start my server and see if it works.

  If it works I would add just this to my controller

  active_scaffold :users

  If that works then I would start to add every link of the
method back one
  at a time.

  Try commenting out all of the active scaffold stuff and see if
your server
  works as expected, and let me know what happens.
  ~Kenny

  On Tue, Feb 2, 2010 at 1:37 PM, Soren Christensen
so...@silikone.com mailto:so...@silikone.comwrote:

  Hi Kenny,

  Thanks for offering your help.

  I do have a the route entry!

  Yes it was working - or perhaps I never triggered the
conditions that
  seems to be causing this. System has grown over time.
  I was trying to look at the AS code - but I'm missing the big
overview of
  it - is there a way to instrument it such that it would list
the columns
  that it is processing - perhaps that could reveal a clue.

  The error appears consistently right after a restart of the
server. The
  controller refuses to start every single time when it is
redirected_to as
  part of the login process.
  If I instead start in one of several other controllers and
then go back to
  users it works fine.
  Is there some loading dependency that I need to cover.
  The model for user only has has_many dependencies - and the
full log
  never lists any of the other models nor controllers.

  /S

  Kenny Ortmann wrote:

  This is random and might be hard to track down...
  do you have
  map.resources :users, :active_scaffold = true

  in your routes? This shouldn't matter for the create method
but I'm just
  trying to narrow things down.

  Was this controller working

Re: What causes the undefined method `create' for # (NoMethodError)

2010-02-02 Thread Soren Christensen

I have ruby-1.8.6.p36-20.4

The problem in particular happens when my session controller redirects 
to the users controller upon login.

Happens both with Mongrel and Phusion.

Here is the full trace:

undefined method `create' for UsersController:Class

|/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb:24:in
 `send'
/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb:24:in
 `method_missing'
/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:186:in
 `method_missing'
/rails/formdir_v2/app/controllers/users_controller.rb:22:in `__instance_exec0'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/object/extending.rb:74:in
 `send'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/object/extending.rb:74:in
 `instance_exec'
/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb:11:in
 `configure'
/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold.rb:61:in 
`active_scaffold'
/rails/formdir_v2/app/controllers/users_controller.rb:16
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in
 `load_without_new_constant_marking'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in
 `load_file'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
 `new_constants_in'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:379:in
 `load_file'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:259:in
 `require_or_load'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:425:in
 `load_missing_constant'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in
 `const_missing'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in
 `const_missing'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:361:in
 `constantize'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in
 `each'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in
 `constantize'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in
 `constantize'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:443:in
 `recognize'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:436:in
 `call'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in
 `dispatch'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in
 `_call'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in
 `build_middleware_stack'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in
 `call'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in
 `call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in
 `call'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/abstract_store.rb:122:in
 `call'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in
 `call'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
 `cache'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in
 `cache'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in
 `call'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in
 `call'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in
 `call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:114:in
 `call'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:in
 `run'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in
 `call'
/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/rack/request_handler.rb:92:in
 `process_request'
/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_request_handler.rb:207:in
 `main_loop'

Re: What causes the undefined method `create' for # (NoMethodError)

2010-02-02 Thread Soren Christensen
/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in `call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
/usr/lib64/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in 
`call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/chunked.rb:15:in `call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:64:in 
`process'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in 
`process_client'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in 
`process_client'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:34:in `run'
/usr/lib64/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111
/usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in 
`gem_original_require'
/usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
script/server:3|



Soren Christensen wrote:

I have ruby-1.8.6.p36-20.4

The problem in particular happens when my session controller redirects 
to the users controller upon login.

Happens both with Mongrel and Phusion.

Here is the full trace:
undefined method `create' for UsersController:Class
|/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb:24:in
 `send'
/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb:24:in
 `method_missing'
/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:186:in
 `method_missing'
/rails/formdir_v2/app/controllers/users_controller.rb:22:in `__instance_exec0'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/object/extending.rb:74:in
 `send'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/object/extending.rb:74:in
 `instance_exec'
/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb:11:in
 `configure'
/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold.rb:61:in 
`active_scaffold'
/rails/formdir_v2/app/controllers/users_controller.rb:16
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in
 `load_without_new_constant_marking'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in
 `load_file'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
 `new_constants_in'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:379:in
 `load_file'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:259:in
 `require_or_load'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:425:in
 `load_missing_constant'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in
 `const_missing'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in
 `const_missing'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:361:in
 `constantize'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in
 `each'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in
 `constantize'
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in
 `constantize'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:443:in
 `recognize'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:436:in
 `call'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in
 `dispatch'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in
 `_call'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in
 `build_middleware_stack'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in
 `call'
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in
 `call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
/usr

Re: What causes the undefined method `create' for # (NoMethodError)

2010-02-02 Thread Soren Christensen
 active_scaffold_config.update.columns.exclude :roles
   end
 else
   active_scaffold_config.list.columns.exclude :login, :state, :roles
 end
   end
 end

I have some additional methods in there to support the 
restful_authentication plugin etc.
They are likely all just the standard stuff. Let me know if we want 
those too.


/S


Kenny Ortmann wrote:

can you paste the entire users_controller please?

On Tue, Feb 2, 2010 at 10:43 AM, Soren Christensen so...@silikone.com 
mailto:so...@silikone.com wrote:



Noted that there was some problem with my config.columns

They looked like this:

config.columns.exclude :updated_at, :created_at
config.create.columns = [:login, :first_name, :last_name,  ]
config.show.columns = [:first_name, :last_name, . ]
config.list.columns = [:login, :state, :first_name,
:last_name,  ]
config.update.columns = [:first_name, :last_name, :address,
.. ]

users_controller:16 is
  active_scaffold :user do |config|


Here is the new backtrace:


|/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb:19:in
 `method_missing'

/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:186:in
 `method_missing'

/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:137:in
 `send'

/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:137:in
 `_load_action_columns'

/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/actions.rb:20:in
 `each'

/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/actions.rb:20:in
 `each'

/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:136:in
 `_load_action_columns'

/rails/formdir_v2/vendor/plugins/active_scaffold/lib/active_scaffold.rb:63:in 
`active_scaffold'
/rails/formdir_v2/app/controllers/users_controller.rb:16

/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in
 `load_without_new_constant_marking'

/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in
 `load_file'

/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
 `new_constants_in'

/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:379:in
 `load_file'

/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:259:in
 `require_or_load'

/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:425:in
 `load_missing_constant'

/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in
 `const_missing'

/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in
 `const_missing'

/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:361:in
 `constantize'

/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in
 `each'

/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in
 `constantize'

/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in
 `constantize'

/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:443:in
 `recognize'

/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:436:in
 `call'

/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in
 `dispatch'

/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in
 `_call'

/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in
 `build_middleware_stack'

/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in
 `call'

/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in
 `call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in 
`call'

/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in
 `call'

/usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/abstract_store.rb:122:in
 `call'

/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in
 `call'

/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
 `cache'

/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in
 `cache'

/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in
 `call'

/usr/lib64/ruby/gems/1.8

Re: What causes the undefined method `create' for # (NoMethodError)

2010-02-02 Thread Soren Christensen

Hi Kenny,

Thanks for offering your help.

I do have a the route entry!

Yes it was working - or perhaps I never triggered the conditions that 
seems to be causing this. System has grown over time.
I was trying to look at the AS code - but I'm missing the big overview 
of it - is there a way to instrument it such that it would list the 
columns that it is processing - perhaps that could reveal a clue.


The error appears consistently right after a restart of the server. The 
controller refuses to start every single time when it is redirected_to 
as part of the login process.
If I instead start in one of several other controllers and then go back 
to users it works fine.

Is there some loading dependency that I need to cover.
The model for user only has has_many dependencies - and the full log 
never lists any of the other models nor controllers.


/S


Kenny Ortmann wrote:

This is random and might be hard to track down...
do you have
map.resources :users, :active_scaffold = true

in your routes? This shouldn't matter for the create method but I'm 
just trying to narrow things down.


Was this controller working at one point in time?
~Kenny

On Tue, Feb 2, 2010 at 12:44 PM, Soren Christensen so...@silikone.com 
mailto:so...@silikone.com wrote:


Sure!

class UsersController  ApplicationController

  include ERB::Util # to get the h function loaded

  layout default,  :except = [ :create2, :new2,
:forgot_password , :reset_password]

  # Protect these actions behind an admin login
  before_filter :admin_required, :only = [:suspend, :unsuspend,
:su, :destroy, :purge]

  before_filter :login_required
  skip_before_filter :login_required, :only = [:new2, :create2,
:activate, :forgot_password, :reset_password]

  # This is the hook for Active Scaffold to dynamically modify the
list of columns.

  before_filter :update_table_config


  active_scaffold :user do |config|


#config.columns = [:login, :first_name, :last_name, :address,
:city, :zip, :email, :home_phone, :cell_phone, :work_phone]

config.columns.exclude :updated_at, :created_at

# Config adds the password columns
config.create.columns = [:login, :first_name, :last_name,
:address, :city, :zip, :email, :home_phone, :cell_phone,
:work_phone, :password, :password_confirmation]

config.show.columns = [:first_name, :last_name, :address,
:city, :zip, :email, :home_phone, :cell_phone, :spouse_first_name,
:spouse_last_name, :spouse_address, :spouse_city, :spouse_zip,
:spouse_email, :spouse_home_phone, :spouse_cell_phone,
:spouse_work_phone]

config.list.columns = [:login, :state, :first_name,
:last_name, :spouse_first_name, :spouse_last_name, :address,
:city, :zip, :email, :home_phone, :cell_phone, :spouse_work_phone]

config.update.columns = [:first_name, :last_name, :address,
:city, :zip, :email, :home_phone, :cell_phone, :work_phone,
:spouse_first_name, :spouse_last_name, :spouse_address,
:spouse_city, :spouse_zip, :spouse_home_phone, :spouse_cell_phone,
:spouse_work_phone, :spouse_email]


config.list.always_show_search = true

config.actions.swap :search, :live_search

config.list.sorting = [{ :last_name = :asc}, {:first_name =
:asc}]

config.columns[:home_phone].description =
  Please just enter 10 digits, no spaces, dashes(-), nor ()
config.columns[:cell_phone].description =
  Please just enter 10 digits, no spaces, dashes(-), nor ()
config.columns[:work_phone].description =
  Please just enter 10 digits, no spaces, dashes(-), nor ()
config.columns[:first_name].description =
  Please enter data as you want it printed on Forms,
Directories etc
config.columns[:last_name].description =
  Please enter data as you want it printed on Forms,
Directories etc
config.columns[:address].description =
  Please enter data as you want it printed on Forms,
Directories etc
config.columns[:city].description =
  Please enter data as you want it printed on Forms,
Directories etc

config.columns[:spouse_last_name].description =
  Please enter data as you want it printed on Forms,
Directories etc
config.columns[:spouse_first_name].description =
  Please enter data as you want it printed on Forms,
Directories etc
config.columns[:spouse_home_phone].description =
  Please just enter 10 digits, no spaces, dashes(-), nor ()
config.columns[:spouse_cell_phone].description =
  Please just enter 10 digits, no spaces, dashes(-), nor ()
config.columns[:spouse_work_phone].description =
  Please just enter 10 digits, no spaces, dashes(-), nor ()
config.columns[:spouse_address].description =
  Please enter data

Re: action_links.add

2009-11-20 Thread Soren Christensen

1) Check the URL that are in the links in your browser. The params[:id] 
will be set to uniquely identify each record.

2) This is not an AS issue. In your revert method you can call whatever 
method in the model to destroy the data that you want to destroy. You 
might want to check the ActiveRecord documentation for details.

/S

On 11/20/2009 1:43 PM, RVince wrote:
 I am trying to put an action_link for each row which would take the
 data from that row, repackage it up and put it into a different table
 (with a different format), then, delete this row from the current
 table. :

 config.action_links.add :revert, :label =  'Revert', :type =  :record

 Subsequently in my controller I create:

 def revert

 end

 And in this method, the questions arise:
 1. How do I access the record of the row that this action link,
 Revert has been clicked on so I can access its data -and-
 2. How do I delete this row within AS?

 Thanks, R. Vince

 --

 You received this message because you are subscribed to the Google Groups 
 ActiveScaffold : Ruby on Rails plugin group.
 To post to this group, send email to activescaff...@googlegroups.com.
 To unsubscribe from this group, send email to 
 activescaffold+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/activescaffold?hl=.




--

You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=.




NoMethodError in latest version of AS

2009-11-12 Thread Soren Christensen
Just upgraded to the latest version of AS, restarted the servers.
And now this.
Some controllers work, some clearly do not work.

Any recommendations on where to begin debugging this problem ?

/S


undefined method `create' for #ActiveScaffold::Config::Core:0x2ae9429102c0

|RAILS_ROOT: /rails/formdir-dev|

Application Trace http://formdir.silikone.com/students# | Framework 
Trace http://formdir.silikone.com/students# | Full Trace 
http://formdir.silikone.com/students#

|/rails/formdir-dev/vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb:19:in
 `method_missing'
/rails/formdir-dev/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:186:in
 `method_missing'
/rails/formdir-dev/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:137:in
 `send'
/rails/formdir-dev/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:137:in
 `_load_action_columns'
/rails/formdir-dev/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/actions.rb:20:in
 `each'
/rails/formdir-dev/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/actions.rb:20:in
 `each'
/rails/formdir-dev/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:136:in
 `_load_action_columns'
/rails/formdir-dev/vendor/plugins/active_scaffold/lib/active_scaffold.rb:63:in 
`active_scaffold'
/rails/formdir-dev/app/controllers/klasses_controller.rb:17
/rails/formdir-dev/app/controllers/students_controller.rb:7|

--

You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=.




Re: custom links

2009-11-10 Thread Soren Christensen

Chris,

Is this not the action_links as described in the documentation ?

You can insert them both on a per-record basis or on a per-table basis.

You can however not control the ID that is passed to the code in the 
action_link when used on a per-record basis. I fought this one for a 
while until I realized that you just have a small piece of code in the 
function called by the action link that translate the ID to whatever it 
needs to be - (DUH!). Sounds simple here - just did not occur to me that 
day.

Let me know if you want examples for the action_link. Also check the 
wiki on GitHub.

/S

On 11/10/2009 12:39 PM, Chris Drappier wrote:
 I have the need to create a link that doesn't appear to fit in with 
 the link customizability described in the documentation, this link 
 will be for each record, should be inside the actions column, and use 
 attributes of the record to create the link.  i need something that 
 works like the column helpers, where if you have a column foo on your 
 model, you can create a method in a helper called def 
 foo_column(record) to customize what is inside this column. it does 
 not appear that action links work the same way. is this true? is there 
 any way i can emulate this functionality for links?

--

You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=.




Re: custom links

2009-11-10 Thread Soren Christensen

In your controller where you have the config block for the 
ActiveScaffold you need:

   active_scaffold :payment do |config|

   # details can be found at: 
http://wiki.github.com/activescaffold/active_scaffold/api-action-link

   config.action_links.add 'statement',
   :label = Statement,
   :type = :record,
   :inline = false

  config.action_links.add 'home', :controller = 'forms',
   :action = index, :page = true,
   :label = Home Page

   end

When you write in the list view for things, I want to have a link ... 
are you also trying to say that you only use the view portion of AS or 
are you generally using AS ?
What I show you above is a standard full use of AS where it handles all 
of the CRUD actions. You can easily extend it - but get the basics 
working first.

/S

On 11/10/2009 7:57 PM, Chris Drappier wrote:
 Soren,

 please consider this scenario :

 class Thing  ActiveRecord::Base
   has_many :comments, :as = :commentable
 end

 class Comment  ActiveRecord::Base
   belongs_to :commentable
 end

 ActionController::Routing::Routes.draw do |map|
  map.resources :things, :active_scaffold = true do |thing|
 thing.resources :comments, :shallow = true, :active_scaffold = true
  end
 end

 in the list view for things, I want to have a link on each thing that 
 is labeled New Comment and points to things/1/comments/new

 I hope this is really simple and I'm just not seeing it. Thanks for 
 your help :)

 -C
 On Tue, Nov 10, 2009 at 8:32 PM, Soren Christensen so...@silikone.com 
 mailto:so...@silikone.com wrote:


 Chris,

 Is this not the action_links as described in the documentation ?

 You can insert them both on a per-record basis or on a per-table
 basis.

 You can however not control the ID that is passed to the code in the
 action_link when used on a per-record basis. I fought this one for a
 while until I realized that you just have a small piece of code in the
 function called by the action link that translate the ID to
 whatever it
 needs to be - (DUH!). Sounds simple here - just did not occur to
 me that
 day.

 Let me know if you want examples for the action_link. Also check the
 wiki on GitHub.

 /S

 On 11/10/2009 12:39 PM, Chris Drappier wrote:
  I have the need to create a link that doesn't appear to fit in with
  the link customizability described in the documentation, this link
  will be for each record, should be inside the actions column,
 and use
  attributes of the record to create the link.  i need something that
  works like the column helpers, where if you have a column foo on
 your
  model, you can create a method in a helper called def
  foo_column(record) to customize what is inside this column. it does
  not appear that action links work the same way. is this true? is
 there
  any way i can emulate this functionality for links?

 --

 You received this message because you are subscribed to the Google
 Groups ActiveScaffold : Ruby on Rails plugin group.
 To post to this group, send email to
 activescaffold@googlegroups.com
 mailto:activescaffold@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/activescaffold?hl=.



 --

 You received this message because you are subscribed to the Google 
 Groups ActiveScaffold : Ruby on Rails plugin group.
 To post to this group, send email to activescaff...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/activescaffold?hl=.

--

You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=.




Re: Active Scaffold Without Database connection --- Help

2009-11-09 Thread Soren Christensen

I barked up this tree once - here is what I learned.

ActiveScaffold is designed to work with ActiveRecord in Rails. If you 
MUST (and carefully consider must) have no database you best 
alternatives are to look for the plugins that can make ActiveRecord live 
without a database.

/S


On 11/8/2009 10:55 PM, Antony Prabhu wrote:
 Hi Friends,

 I want to know what are ways or how to use the Active Scaffold without
 Database connection 

 I mean  Instead of Database I will have a CSV or Flat file.

 Thro Active Scaffold Plug-in how to read this file instead of
 database

 Kindly Can I have you Ideas and Views. ASAP.


 - Antony

 --

 You received this message because you are subscribed to the Google Groups 
 ActiveScaffold : Ruby on Rails plugin group.
 To post to this group, send email to activescaff...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/activescaffold?hl=en.




--

You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaff...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.




Re: Generate PDF in action_links

2009-10-14 Thread Soren Christensen

Not sure what your actual needs are but you can pass instance variables 
into the PDF writer just as you can in an normal .erb template/

So anything that you would have done in a normal view file can be done 
in the pdf view files.
Try to create it as a standalone first and then integrate it into the 
actionlinks of AS.

so I have a print function in my controller:
 def some_page
@form = Form.find_by_user_id(current_user.id)
@students = Student.find_by_owner(current_user.id)
  end

Inside the page I have several structures typical of a template:
You can call partials:
render :partial='hdr_c3', :format = 'pdf',  :locals={:p_user = @user}
render :partial='students', :format = 'pdf',  :locals={:p_students = 
@students}

You can have loops to access the instance variables defined in the 
controller
  @students.each do |b|
a_numbers += b.first_name + :  + 
number_to_currency(@form[Form::A_INDEX[n]]) + \n unless b.klass_id.nil?
  end

You have access to the params[:id] (and everything else in params) to 
use in your code

To link to a pdf I use:
%= link_to(@pdficon+Print all my personalized Forms, {:action = 
'package', :id = current_user.id, :format = 'pdf'}, :popup = 
Konfig::POPTIONS2) %

Hope this helps you
/S

adc wrote:
 I try Prawn and Prawn_to, but i have some problems with generate
 file .pdf.

 I want to create a new page (print.pdf) and pass the data of record
 through an action like show, delete etc...

 How can I make this operation?

 Thanks for all

 ADC

 On 23 Giu, 18:54, Soren Christensen so...@silikone.com wrote:
   
 Rails is trying to render the template for the function. So you can move
 some of the text into the template.

 I would suggest that you also add the parameter :format = pdf to the
 action link.

 It changes the template naming to be  method.pdf.erb

 You can also take a look at Prawn and Prawnto. There is a great
 railscasts.com episode on those.

 /S

 adcwrote:
 
 I created an action link with
   
 1. config.action_links.add 'generate_pdf', :label=Stampa
 PDF, :type=:record
   
 and i defined
   
  def generate_pdf
 pdf = PDF::Writer.new
 pdf.select_font(Helvetica)
 pdf.text(Ciao Ale)
 #pdf.text(Hello Ruby.HTML.it, 72, :justification=center)
 pdf.save_as(public/example.pdf)
   end
   
 The pdf is correct but there is an error
 - ActionController::MissingTemplate (Missing template admin/dmwaters/
 generate_pdf.html.erb
   
 but I would like to bring up the message PDF Generate ok like Error
 Message in active scaffold.
   
 Thanks for all
   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~--~~~~--~~--~--~---



Re: initialize a create form field?

2009-10-07 Thread Soren Christensen



Previously the template for do_new was:

   def do_new
 @record = active_scaffold_config.model.new

 @record.field = value
...

 @record
   end

Is there a need to rewrite any of the older templates.

/S


On 10/7/2009 2:27 AM, helmerj wrote:
 Hi Sergio,

 Cool!

 Will give that a go!

 Thanks
 J.

 On 29 Sep., 11:59, Sergio Cambra .:: entreCables S.L. ::.
 ser...@entrecables.com  wrote:

 On Martes, 29 de Septiembre de 2009 08:54:18 helmerj escribió:

  
 Hi,

  
 I read the docs and googled all over the place but I could not find a
 way to preinitialize a create form field using active scaffold.

  
 I have a number filed in a model and I would like to get the number of
 the last record add one and initialize the number field of my create
 view with it.

  
 I am sure there must be a way using a controller entry and a field
 override. All my attempts didn't work though...

  
 I'd appreciate any pointers

 You can override do_new and set in @record what you want to show as default
 values.
 def do_new
super
@record.your_column = your_value
other custom code
 end



  
 Cheers J.

 --
 Sergio Cambra .:: entreCables S.L. ::.
 Mariana Pineda 23, 50.018 Zaragoza
 T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com
  
 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~--~~~~--~~--~--~---



Re: ActiveScaffoldExport - undefined method `create' for #ActiveScaffold::Config::Core

2009-09-29 Thread Soren Christensen

I had:

config.create.columns = [ . ]

Which then got removed along with
config.update.columns = [ ... ]

Now the error message points back to the core of AS:
.
Loading rack/utils
Loading action_controller
Loading action_controller
Loading dispatcher
Loading action_controller/dispatcher
Loading /rails/formdir-dev/app/models/user_observer
Loading /rails/formdir-dev/app/models/user
Loading digest/sha1
Loading aasm
Loading /usr/lib64/ruby/gems/1.8/gems/rubyist-aasm-2.1.1/lib/aasm/aasm
Loading /usr/lib64/ruby/gems/1.8/gems/rubyist-aasm-2.1.1/lib/aasm/event
Loading 
/usr/lib64/ruby/gems/1.8/gems/rubyist-aasm-2.1.1/lib/aasm/state_transition
Loading /usr/lib64/ruby/gems/1.8/gems/rubyist-aasm-2.1.1/lib/aasm/state
Loading 
/usr/lib64/ruby/gems/1.8/gems/rubyist-aasm-2.1.1/lib/aasm/state_machine
Loading ostruct
Loading 
/usr/lib64/ruby/gems/1.8/gems/rubyist-aasm-2.1.1/lib/aasm/persistence
Loading 
/rails/formdir-dev/vendor/plugins/restful_authentication/lib/authorization
Loading 
/rails/formdir-dev/vendor/plugins/restful_authentication/lib/authorization/aasm_roles
Loading 
/usr/lib64/ruby/gems/1.8/gems/rubyist-aasm-2.1.1/lib/aasm/persistence/active_record_persistence
Loading set
Loading mysql
Loading mysql_api
Loading /rails/formdir-dev/app/models/car
Loading /rails/formdir-dev/app/models/contact
Loading /rails/formdir-dev/app/models/donation
Loading /rails/formdir-dev/app/models/event
Loading /rails/formdir-dev/app/models/form
Loading /rails/formdir-dev/app/models/klass
Loading /rails/formdir-dev/app/models/student
Loading /rails/formdir-dev/app/models/google
Loading google4r/checkout
Loading google4r/checkout/shared
Loading google4r/checkout/commands
Loading openssl
Loading money
Loading money/money
Loading money/variable_exchange_bank
Loading thread
Loading money/errors
Loading money/symbols
Loading money/core_extensions
Loading net/http
Loading net/https
Loading uri
Loading google4r/checkout/notifications
Loading rexml/document
Loading google4r/checkout/xml_generation
Loading stringio
Loading rexml/document
Loading google4r/checkout/frontend
Loading google4r/checkout/merchant_calculation
Loading rexml/document
Loading /rails/formdir-dev/app/models/help
Loading /rails/formdir-dev/app/models/konfig
Loading active_support/multibyte/chars
Loading active_support/multibyte/exceptions
Loading active_support/multibyte/unicode_database
Loading /rails/formdir-dev/app/models/mailing
Loading /rails/formdir-dev/app/models/matching_grant
Loading /rails/formdir-dev/app/models/note
Loading /rails/formdir-dev/app/models/payment
Loading /rails/formdir-dev/app/models/qbook
Loading quickbooks
Loading time
Loading quickbooks/extlib
Loading quickbooks/extlib/class
Loading quickbooks/extlib/object
Loading quickbooks/extlib/string
Loading pathname
Loading quickbooks/extlib/hash
Loading rexml/parsers/streamparser
Loading rexml/parsers/baseparser
Loading rexml/light/node
Loading rexml/xmltokens
Loading rexml/light/node
Loading quickbooks/extlib/time
Loading date
Loading quickbooks/extlib/assertions
Loading quickbooks/extlib/inflection
Loading quickbooks/extlib/days_and_times
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/extlib/days_and_times/duration
Loading time
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/extlib/days_and_times/numeric
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/extlib/days_and_times/duration
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/extlib/days_and_times/time
Loading time
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/extlib/days_and_times/object
Loading quickbooks/ruby_ext
Loading rexml/light/node
Loading rexml/document
Loading quickbooks/xsd
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/xsd/xml_parse
Loading rexml/light/node
Loading rexml/document
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/xsd/validation
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/xsd/element
Loading quickbooks/element
Loading quickbooks/property
Loading quickbooks/types
Loading quickbooks/type
Loading quickbooks/types
Loading date
Loading quickbooks/option
Loading quickbooks/property
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/xsd/group
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/xsd/sequence
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/xsd/simple_type
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/xsd/complex_type
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/xsd/restriction
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/xsd/choice
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/xsd/union
Loading 
/usr/lib64/ruby/gems/1.8/gems/quickbooks-1.0.0/lib/quickbooks/xsd/attribute
Loading quickbooks/element_collection
Loading quickbooks/element
Loading 

Re: I can't add a new column to my acitve_scaffold, I just added a column to the database

2009-09-24 Thread Soren Christensen


You are missing a : in front of center_manager2 and you have an extra , 
at the end of the line.

Are you in production mode ? i.e. - do you need to restart your rails 
server ?

/S

On 9/24/2009 9:17 AM, Barnettech wrote:
 The active scaffold is working great I just can't add new columns to
 the database/active_scaffold.  Please help.

 I just manually added 2 columns to the database, I don't use
 migrations currently.  I added the columns to this line in my
 controller (I added center_manager1 and center_manager2):

 config.columns =
 [:page_title,:page_heading_title,:page_stub,:parent,:short_description,:meta_keywords,:main_content,
  
 :address_line_1,:address_line_2,:search_link,:map_google,:map_yahoo,:phone,:center_manager1,center_manager2,:located_brief,:directions,:parking,:public_transportation,:image_url_1,:image_url_2,:image_url_3,:location_holidays,:location_hours,]

 and it doesn't recognize the new column:

 I get this error:

 ActionView::TemplateError (undefined method `center_manager1' for
 #Location:0x688ac9c) on line #7 of vendor/plugins/active/frontends/
 default/views/_form_attribute.rhtml:
 4:label for=%= record_#{column.name} %%= column.label
 %/label
 5:/dt
 6:dd
 7:%= active_scaffold_input_for column, scope %
 8:% if column.description -%
 9:span class=description%= column.description %/span
 10:% end -%

  c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/
 active_record/attribute_methods.rb:205:in `method_missing'
  c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/
 helpers/form_helper.rb:562:in `send'
  c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/
 helpers/form_helper.rb:562:in `value_before_type_cast'
  c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/
 helpers/form_helper.rb:550:in `value_before_type_cast'
  c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/
 helpers/form_helper.rb:465:in `to_input_field_tag'
  c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/
 helpers/form_helper.rb:289:in `text_field'
  vendor/plugins/active/lib/helpers/form_column_helpers.rb:165:in
 `active_scaffold_input_virtual'
  vendor/plugins/active/lib/helpers/form_column_helpers.rb:24:in
 `active_scaffold_input_for'
  vendor/plugins/active/frontends/default/views/
 _form_attribute.rhtml:7:in
 `_run_erb_47vendor47plugins47active47frontends47default47views47_form_attribute46rhtml'
  c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/
 base.rb:637:in `send'
  c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/
 base.rb:637:in `compile_and_render_template'
  c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/
 base.rb:365:in `render_template'
  c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/
 base.rb:316:in `render_file'
  c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/
 base.rb:331:in `render_without_active_scaffold'
  vendor/plugins/active/lib/extensions/action_view_rendering.rb:
 56:in `render'

 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~--~~~~--~~--~--~---



Re: Column Sorting for linked tables

2009-09-11 Thread Soren Christensen

Great !
This works perfect. Thanks a bunch.

Now how does one get the Live Search to also be able to search these 
fields ?

/S


Sergio Cambra .:: entreCables S.L. ::. wrote:
 On Jueves, 10 de Septiembre de 2009 00:12:48 Soren Christensen escribió:
   
 The classes have a name which is a string.

 What magic incantation is required to make the searching work right.
 Right now a
 list.sorting = { :klass = 'ASC'}

 will cause the listing to be sorted based on the numerical value of the
 klass_id field rather than the name of the klass that the klass_id
 points to.
 

 Try with config.columns[:school].sort_by :sql = 'schools.name'

   
 /S



 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~--~~~~--~~--~--~---



Multiple select boxes - an array of check_boxes

2009-09-10 Thread Soren Christensen

Hi,

I have an application where I need to select the recipients of an e-mail.
I do this using a combination of the following:

- a checkbox to deliver to all
- a multiple select to select a set of groups

This is currently done with AS - Wondering if this is the best solution.

3 questions:

1) I use this to build the multiple select boxes. They store their 
values fine in the database, but nothing is selected when I edit them.
  Has anybody gotten this to work correctly:

  def klass_ids_form_column(record, input_name)
  select_tag(record[klass_ids][],
   options_for_select(Klass.find(:all).sort { |a,b| 
a.name.casecmp(b.name)}.collect {|p| [ p.to_label, p.id ] },
   record.klass_ids.collect { |cr| cr.id}), {:multiple=true, :size=6})
  end

2) Rather than having a multiple select box I would like a set of check 
boxes. Much more obvious user interface

  is there a simple way to do this ?
  or can the code in 1) be converted like:

  def klass_ids_form_column(record, input_name)

  Klass.find(:all).sort { |a,b| a.grade = b.grade}.each do |kl|
check_box_tag(record[klass_ids][], #{kl.id}, 
record[klass_ids].include?(kl.id))
  end
  end

3) And for the really nice version:
Make 2) work, but use AJAX to show/remove the second level of checkboxes 
- they are only shown if all is not checked.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~--~~~~--~~--~--~---



Column Sorting for linked tables

2009-09-09 Thread Soren Christensen

Hi,

Say we have the classical Students and School Class scenario, where the 
students have a link to the class that they belong to.

The classes have a name which is a string.

What magic incantation is required to make the searching work right. 
Right now a
list.sorting = { :klass = 'ASC'}

will cause the listing to be sorted based on the numerical value of the 
klass_id field rather than the name of the klass that the klass_id 
points to.

/S


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~--~~~~--~~--~--~---



Re: Inline Action Link

2009-07-07 Thread Soren Christensen

Users is already an AS controller. Its a hybrid of the users that can 
log in, and the users that are also the parents. So there are 
substantially more fields in my users model that what you would see in 
some other cases. Parents and Users are used interchangeably.

Users/Parents has a number of Students so just sending the student.id to 
the show action does not work.
That was why I had the two lookup's to get the the parent ID before 
rendering the show.
Is there way to reference the show and have the ability to control what 
record is show.

Next step is to apply the privacy rules to the displayed data. I assume 
that this can be done with helper methods.

/S


Kenny Ortmann wrote:
 You could make a User Controller and use the show method in the user 
 controller and then just configure the action link to point to that 
 controller.  But from the look of things you are using the User 
 controller as an Active Scaffold controller already aren't you?

 When you say Parent, the parent is just the parent record correct?

 ~Kenny

 On Tue, Jul 7, 2009 at 7:15 AM, Soren Christensen so...@silikone.com 
 mailto:so...@silikone.com wrote:


 Hi,

 I have a User mode, and a Student model and use AS for all of my CRUD
 action.

 I'm trying to build a function that should show the parents of a
 particular student. Would love to make it an 'visual extension' to AS.

 But how - the rails portion was easy - but how do I display it ?
 Shall I grab the show method/template from AS and user that as a
 template or is there a better method.

 Just trying to do:

  def parents

   student= Student.find(params[:id])

   @record = User.find(student.user_id)

   render :controller = 'users', :action = 'show', :id =
 @record.id http://record.id

  end


 Gives me what I want, but the headline is wrong !
 It shows :

 Show Student  (Should have been Show User)
 and then it gives me the items the the show view is configured to
 display.

 Is there a better way to do this ?

 And can one grab
 
 vendor/plugins/active_scaffold/frontends/default/views/_show_columns.html.erb,
 and placed a modified version in my view directory to customize
 the view.

 /S







 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~--~~~~--~~--~--~---



Re: Cookie Session Storage exceeded

2009-07-05 Thread Soren Christensen


Is the solution this simple ?

Remove:
  config.action_controller.session = {
:session_key = '_formdir_session',
:secret  = 'xxx'
  }

from environment.rb ?
Will this disable the forgery_protection ?

And sorry if this is too far off topic - but there has recently been a 
long discussion on how the sessions variables was affected by the use of 
AS. But I should probably have written that in my first post.

/S

Soren wrote:
 Hi,

 Like many other apps I have now hit the ceiling on the Cookie based
 Session variables.
 So I tried to change to ActiveRecord based variables.

 Did so by changing:
 config/environment.rb:
   config.action_controller.session_store = :active_record_store

 Ran:
 rake db:sessions:create
 to create the sessions table database

 rake db:migrate
 To build and activate the new database

 But now no one can log into the application. I keep getting
 ActionController::InvalidAuthenticityToken
 (ActionController::InvalidAuthenticityToken):
   passenger (2.1.2) lib/phusion_passenger/rack/request_handler.rb:
 65:in `process_request'

 I restarted the server and apache.

 I tried
 rake db:sessions:clear

 Did not help

 I do have the
 I must have missed something but what ?

 /S
 
   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~--~~~~--~~--~--~---



Re: Generate PDF in action_links

2009-06-23 Thread Soren Christensen


Rails is trying to render the template for the function. So you can move 
some of the text into the template.

I would suggest that you also add the parameter :format = pdf to the 
action link.

It changes the template naming to be  method.pdf.erb

You can also take a look at Prawn and Prawnto. There is a great 
railscasts.com episode on those.

/S

adc wrote:
 I created an action link with

 1. config.action_links.add 'generate_pdf', :label=Stampa
 PDF, :type=:record

 and i defined

  def generate_pdf
 pdf = PDF::Writer.new
 pdf.select_font(Helvetica)
 pdf.text(Ciao Ale)
 #pdf.text(Hello Ruby.HTML.it, 72, :justification=center)
 pdf.save_as(public/example.pdf)
   end

 The pdf is correct but there is an error
 - ActionController::MissingTemplate (Missing template admin/dmwaters/
 generate_pdf.html.erb

 but I would like to bring up the message PDF Generate ok like Error
 Message in active scaffold.

 Thanks for all
 
   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~--~~~~--~~--~--~---



Include ID parameter in Action Links

2009-06-10 Thread Soren Christensen

Hi,

Is there a way to specify ActionLinks such that the ID parameter in them 
can be calculated, rather than just taken from the current records ID ?

Lets say we have Users and Payments. The list view shows me all the 
payments in the system from all users. Next to each payments I would 
like two ActionLinks.
The first one give me a statement of this users transactions - so it 
need to ID the user.
The second one gives me a statement for the receiving account - so it 
needs the ID of the receiving account.

Clearly I can write around this in the controller - it just leaves so 
much cleaner code if this could be done here.

/S


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~--~~~~--~~--~--~---



Icon's for ActionLinks

2009-06-09 Thread Soren Christensen

Hi,

I have been using the Action Links to add functionality to my various 
interfaces.

I was wondering if there is a way to use Icon's instead of text when you 
are inserting the Actions into the interfaces. Would make it pretty cool.

/S

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~--~~~~--~~--~--~---



Open Live Search as default

2009-06-09 Thread Soren Christensen

Hi,

I know this one has been debated endlessly, but I was unable to find the 
conclusion.

Is there a way to make Live Search be open by default ?

/S

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~--~~~~--~~--~--~---



Re: search broken

2009-05-21 Thread Soren Christensen

Both are 2.3

So far I have seen no other problems.

/S


Kenny Ortmann wrote:
 What version of rails/active scaffold are you using?

 On Thu, May 21, 2009 at 10:47 AM, Soren so...@silikone.com 
 mailto:so...@silikone.com wrote:


 Suddenly I get this error:

 Processing StudentController#show_search (for 192.168.0.216 at
 2009-05-21 08:41:23) [GET]
  Parameters: {eid=92a90c6d5b93d6eac1a8d335c2940dc3,
 action=show_search, _method=get,
 adapter=_list_inline_adapter, controller=student}

 NoMethodError (undefined method `list_search_formats' for
 #StudentController:0x2aae2824afd0):


 This used to work fine - but no longer.

 Any ideas ?





 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~--~~~~--~~--~--~---



Re: How can i add a custom action?

2009-05-20 Thread Soren Christensen


To add a link to some function  for each user do:

config.action_links.add 'respw',
  :label = Reset Password,
  :type = :record,
  :inline = false,
  :security_method = :respw_authorized?


You can then use the secutiy_method to control if this is enabled for 
this particular user - if not it will be inactive and grey

  def respw_authorized?
(current_user.role == 'admin')
  end

Check the doc's re action_link

/S

simon wrote:
 for example , i got a model User for login/logout the system, and use
 user_controlle and active_scaffold to render the manuplation. then i
 want to add a action , change_password, but how can i customly add
 this link for every row/user ?

 
   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~--~~~~--~~--~--~---



Re: rails 2.3 AS render_component and flash madness

2009-05-20 Thread Soren Christensen

Thanks a million Tim !

This was exactly the same issue that I was fighting.

I have several embedded scaffolds and they are working just fine with 
this new render_components under rails 2.3

/S

Tim Uckun wrote:
 When I upgraded to rails 2.3 I could no longer use embedded scaffolds. 
 After much googling I followed the advice on the mailing lists and 
 installed the render_component plugin from lacklac using

 script/plugin install --force 
 git://github.com/lackac/render_component.git 
 http://github.com/lackac/render_component.git -r rails-edge

 Unfortunately that broke flash and none of my flash messages worked 
 anymore.

 After looking at the forks from that I installed

 script/plugin install --force 
 git://github.com/robrasmussen/render_component.git 
 http://github.com/robrasmussen/render_component.git

 And now my flashes are back but I don't know if anything else is broken.

 This is a pretty sorry state of affairs. I am using somebodies fork of 
 somebodies fork of the official plug in  in order to get active 
 scaffold to work because AS uses a call that has been deprecated for a 
 long time and now finally removed from the framework altogether.

 I am posting this here in the hopes that it saves somebody else the 
 hours of digging I had to go through.

 Is AS ever going to remove the dependency on render_component? I 
 certainly don't envision a future where these people will maintain the 
 plugins.



 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
ActiveScaffold : Ruby on Rails plugin group.
To post to this group, send email to activescaffold@googlegroups.com
To unsubscribe from this group, send email to 
activescaffold+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~--~~~~--~~--~--~---