Sign in to follow this  

undefined local variable or method `arr_data'

Recommended Posts

Thanks for this I now have the demo working correctly. I do have one issue though. When I tried to create my own controller and view (including builder) I get the following error




I have copied the helper into lib, edited application helper to reference them, and copied the javascript files. I haven

Share this post

Link to post
Share on other sites

The file names and paths might be causing the problem. This error will occur only if the variable is not being passed via locals hash.


But here are a few things to check:


1. Please ensure that the view .html.erb file has same name as controller action name. In this case "project". Only then @arr_data is visible to it. The name of the view should be project.html.erb in your case

2. Now, in the view, the builder is rendered using render :file=>'dashboard/project' this means that the project.builder file should be in the dashboard folder inside app/views.

3. Next, you cannot have project.html.erb and project.builder in the same folder because you are referencing one from the other (as seen in #2)

Hope this helps.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this