def set_model
@my_controller = Manifest.manifest.controllers[params[:controller].to_s]
@my_action = @my_controller.actions[params[:action].to_s]
- @my_model = Manifest.manifest.models[@my_action.item_name]
+ @my_model = Manifest.manifest.models[@my_controller.item_name]
@my_model_class = @my_model.classify
end
def set_list
set_model
+ @my_list_model = Manifest.manifest.models[@my_action.item_name]
+ @my_list_model_class = @my_list_model.classify
@list = Locmare::ListGroup.list @my_action.item_name, @my_action.list_name
end
:filer => @filer
}
}
- format.json { render json: @items.to_json }
+ format.json { render json: @items.map{|i| i.attributes}.to_json }
+ # rails3.2 has problem
+ # y method defined as private
+ # attribute y conflict at PanelPicture, balloon ..etc
+ # use i.attributes[name]
+ # format.json { render json: @items.to_json }
format.atom
format.rss
end
end
def set_play
- set_model
- @list = Locmare::ListGroup.list @my_action.item_name, @my_action.list_name
+ set_list
+ @item = @my_model_class.show(params[:id], @operators)
end
def play_list
end
def show_json_format_for_root format
- format.json { render json: @item.to_json(@my_model_class.show_json_opt_for_root) }
+ format.json { render json: @item.attributes.to_json(@my_model_class.show_json_opt_for_root) }
end
def set_new