Question

I am looking this video http://railscasts.com/episodes/258-token-fields-revised This is my coffescript code

jQuery ->
  $('#employee_material_asset_tokens').tokenInput '/assets.json'
    theme: 'facebook'
    prePopulate: $('#employee_material_asset_tokens').data('load')

It works fine before but now it gives me error like

ExecJS::ProgramError at /employee/reviews
Error: Parse error on line 5: Unexpected 'INDENT'
  (in /home/prem/rails/heronhrm/app/assets/javascripts/employee/assets.js.coffee)

I am confuse i did not change code It works fine before .. what could be the reason when i change this code like

jQuery ->
$('#employee_material_asset_tokens').tokenInput '/assets.json'
theme: 'facebook'
prePopulate: $('#employee_material_asset_tokens').data('load')

then token input works but prepopulate and theme doesnot work..

Was it helpful?

Solution

i think you're just missing a , after '/assets.json'. Your code should look like

$('#employee_material_asset_tokens').tokenInput '/assets.json',
  theme: 'facebook'
  prePopulate: $('#employee_material_asset_tokens').data('load')
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top