ashkar
ashkar

Reputation: 300

How to resolve JSON syntax errors in rails?

I started learning rails using 'Agile Web Development with Rails, 4th Edition'
with
rails 3.2.7 and ruby 1.9.3p448 (2013-06-27 revision 41675) [i686-linux].
When i tried to edit an html form with

   <%= f.text_area :description  :rows=>6 %>

it returned an error

       /media/ashku/New Volume/RoR/depot/app/views/products/_form.html.erb:19: syntax error, unexpected ':', expecting ')'
...= ( f.text_area :description  :rows=>6 );@output_buffer.safe...

then i tried to change the :rows=>6 to rows: 6 but the results where the same

Discussion here suggests it as problem with JSON

controller code is given here

so how to resolve this problem ?

Upvotes: 3

Views: 158

Answers (3)

HarsHarI
HarsHarI

Reputation: 911

You can use "Better Errors" gem for debugging in development env., this is a better tool to find errors in good way. read about them from http://railscasts.com/episodes/402-better-errors-railspanel?view=asciicast

Upvotes: 1

Amit Sharma
Amit Sharma

Reputation: 3477

You have missed the comma(,) after tag name ie.(:description). So replace your tag with following and try to run..

<%= f.text_area :description, :rows => 6 %> 

Upvotes: 2

sevenseacat
sevenseacat

Reputation: 25029

You're missing a comma in between :description, and :rows.

Upvotes: 2

Related Questions