Class Fusioncharts::FormBasedController
In: app/controllers/fusioncharts/form_based_controller.rb
Parent: ApplicationController

This controller demonstrates the generation of pie-chart by using the values from a form. Only the chart.html.erb view related to the chart action uses the "common" layout. Here, we have given a simple example, where the form fields do not belong to any database In real-world, you would have fields corresponding to the fields of some Model.

Methods

chart   default  

Public Instance methods

Data is obtained from the submitted form (present in the request) In this example, we‘re directly showing this data back on chart. In your apps, you can do the required processing and then show the relevant data only. The view for this action uses the "common" layout.

This action will present a form to the user, to input data. For this demo, we present a very simple form intended for a Restaurant to indicate sales of its various product categories at lunch time (for a week). The form is rendered using the page default.html.erb. It submits its data to chart action. So, basically the view for this action is just a form.

[Validate]