Closed GoogleCodeExporter closed 9 years ago
Please, post your controller
Original comment by sergio.c...@gmail.com
on 12 Apr 2010 at 7:36
Please, post your controller
Original comment by sergio.c...@gmail.com
on 12 Apr 2010 at 7:54
My source code is below. Correction: I'm still seeing two separate error
messages after updating a record.
Thanks.
--
class ItemsController < ActionController::Base
include AuthenticatedSystem # for restful authentication
before_filter :login_required
layout "activescaffold"
active_scaffold :items do |config|
config.list.columns << :active_views
config.nested.add_link("Object images", [:images])
config.columns = ['title', 'category', 'country', 'year', 'dimensions', 'price', 'description', 'url', 'images', 'home',
'collection', 'archive']
config.list.columns = ['title', 'category', 'price', 'url', 'home', 'collection', 'archive']
config.columns[:url].label = "Thumbnail"
config.columns[:home].inplace_edit = true
config.columns[:collection].inplace_edit = true
config.columns[:archive].inplace_edit = true
config.actions.exclude :show
end
end
--
Original comment by christia...@gmail.com
on 12 Apr 2010 at 1:13
Do you get the error when you create a record on items controller? Or do you
get the
JS error when you create a record on images nested scaffold? In that case, post
your
images controller code.
Original comment by sergio.c...@gmail.com
on 12 Apr 2010 at 2:34
Yes, it happens in the nested scaffold. Below is my images controller code.
Removing the 2 lines of "sortable"
code prevents the error from occurring, leading me to think that the culprit
must be the plugin...
--
class ImagesController < ActionController::Base
include AuthenticatedSystem # for restful authentication
before_filter :login_required
layout "activescaffold"
active_scaffold :images do |config|
config.actions << :sortable
config.sortable.column = :position
end
def item
@images = Image.find(:all)
end
end
--
Thanks!
Original comment by christia...@gmail.com
on 13 Apr 2010 at 12:10
I'm attaching screenshots of the error messages I'm getting, in case it helps...
Original comment by christia...@gmail.com
on 13 Apr 2010 at 12:11
Attachments:
Are you using an updated copy of
http://github.com/activescaffold/active_scaffold_sortable?
Original comment by sergio.c...@gmail.com
on 13 Apr 2010 at 7:34
Also, try to copy frontends/default/javascripts/active_scaffold.js to
public/javascripts/active_scaffold/default/active_scaffold.js, maybe that file
wasn't updated when you update the plugin.
Original comment by sergio.c...@gmail.com
on 13 Apr 2010 at 7:39
I installed the latest version of active_scaffold_sortable, and also copied
active_scaffold.js from the
active_scaffold plugin directory to public, but I'm still seeing the error.
Was there intended to be an override of active_scaffold.js in the
active_scaffold_sortable plugin directory? If so, I
couldn't find it...
Thanks.
Original comment by christia...@gmail.com
on 13 Apr 2010 at 10:32
No, there is no override of active_scaffold.js
Can you debug with firebug? Under script menu, check "stop on all errors", and
tell
me line with the error. Or add a breakpoint in line 78.
You can use Safari debugger but I can't give instructions to you.
Original comment by sergio.c...@gmail.com
on 14 Apr 2010 at 7:24
The line with the error appears to be 77: "count.innerHTML =
parseInt(count.innerHTML) + 1;"
Original comment by christia...@gmail.com
on 15 Apr 2010 at 3:12
On deletion, line 72 throws the error: "count.innerHTML =
parseInt(count.innerHTML) - 1;"
Original comment by christia...@gmail.com
on 15 Apr 2010 at 3:23
[deleted comment]
That is not last version:
master ->
http://github.com/activescaffold/active_scaffold/blob/master/frontends/default/j
avas
rails-2.3 ->
http://github.com/activescaffold/active_scaffold/blob/rails-2.3/frontends/defaul
t/ja
Original comment by sergio.c...@gmail.com
on 15 Apr 2010 at 7:12
[deleted comment]
I updated the version, and it no longer throws the above errors. However, I do
still get an error when creating a
new item inside a nested table (though no longer on deletion). I'm attaching
new screenshots of the error, and
can set a breakpoint if that helps. Thanks!
Original comment by christia...@gmail.com
on 15 Apr 2010 at 12:03
Attachments:
Sorry, I can't reproduce that bug. Please add a breakpoint to find the line of
the
error. Have you override on_create.js.rjs on your controller?
Anyway, I have fixed a bug in active_scaffold_sortable, instead of moving to
bottom
the new row it was inserting the row id as text.
Original comment by sergio.c...@gmail.com
on 16 Apr 2010 at 10:50
Your last update fixed the bug! Thanks so much, appreciate your help with this.
Now everything is working
fine...
Thanks,
Christian
Original comment by christia...@gmail.com
on 16 Apr 2010 at 12:02
Original issue reported on code.google.com by
christia...@gmail.com
on 11 Apr 2010 at 3:23