HI Sergio
Trace from rails server
Started GET "/tasks/26/clone?adapter=_list_inline_adapter" for ::1 at
2017-03-11
11:26:59 +0800
ActiveRecord::SchemaMigration Load (0.0ms) SELECT `schema_migrations`.*
FROM
`schema_migrations`
DEPRECATION WARNING: before_filter is deprecated and will be removed in
Rails 5.
1. Use before_action instead. (called from included at
C:/RailsInstaller/Ruby2.2
.0/lib/ruby/gems/2.2.0/bundler/gems/active_scaffold_export-7c9d9af30aaa/lib/acti
ve_scaffold/actions/export.rb:4)
DEPRECATION WARNING: before_filter is deprecated and will be removed in
Rails 5.
1. Use before_action instead. (called from included at
C:/RailsInstaller/Ruby2.2
.0/lib/ruby/gems/2.2.0/bundler/gems/active_scaffold_export-7c9d9af30aaa/lib/acti
ve_scaffold/actions/export.rb:5)
Processing by TasksController#clone as JS
Parameters: {"adapter"=>"_list_inline_adapter", "id"=>"26"}
Task Load (15.6ms) SELECT `tasks`.* FROM `tasks` WHERE `tasks`.`id` =
26 LIM
IT 1
(0.0ms) BEGIN
Task Exists (0.0ms) SELECT 1 AS one FROM `tasks` WHERE `tasks`.`task` =
BINA
RY 'Activate Authentication' LIMIT 1
(0.0ms) ROLLBACK
No template found for TasksController#clone, rendering head :no_content
Completed 204 No Content in 10278ms (ActiveRecord: 15.6ms)
On Saturday, 11 March 2017 11:24:45 UTC+8, Chee Chong Hwa wrote:
>
> Hi Segio
>
> Tasks Controller
>
> conf.action_links.add 'clone', :label => 'Clone', :page => false, :type
> => :member
> Nb. This displays corretly on per record basis
>
> def clone
> old_task = Task.find(params[:id])
> new_task = old_task.dup
> new_task.save
> end
>
> Routes.rb
> resources :tasks, concerns: :active_scaffold
> resources :tasks do
> member do
> get 'clone' =>"tasks#clone"
> end
> as_routes
> end
>
> Issue: When I click clone... something is happening but the duplicate
> record is not being save or perhaps not duplicated at all
>
> BTW, I got the idea from
> http://stackoverflow.com/questions/60033/what-is-the-easiest-way-to-duplicate-an-activerecord-record
>
> Q. What have I done wrong ?
>
>
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.