Loading and rendering json in Rails 3.1

I am using rails 3.1 with jquery and want to use jstree to present
some hierarchical data. That plugin then demands one to render json
and to load it in to the jstree
I have googled for some guides about how to achieve that but have not
found any useful information

After these studies I think the way to go is

  1. to install the jstree plugin requesting the code in the js manifest
    file and may be also using the ui-theme
  2. render json data from some appropriate action.
    Will that create a appropriate data structure in a .json file or
    will it just define some variables that can be used in the .json file
    as when one render html views ?
  3. How is that data loaded into the jstree plugin ?
    Can one define in the plugin that it should read the .json file,
    or does one have to define some javascript variable to transfer data.
    One can also define a url in the jstree plugin to get data from the
    server. Should that point to an action that generate the .json file as
    a partial ?

I have learned how to use unbtrustrusive javasccritp in rails 3.1
This is described in different guides and railscasts, but I cannot
find any similar description of how to use
jsone data in that context

Any help to understand that process would be much appriciated by me
and also I think by many others

Here are some railscast that may help