how to return values in json that contain models to be associated using JBuilderHow can I “pretty” format my JSON output in Ruby on Rails?How to check whether a string contains a substring in Ruby?can't convert nil into an exact numberCalling attributes of an associated model in the viewRender html partial in JSON JBuilderModel with custom table name return values of other typeRails 4: nested attributes and PG::NotNullViolation ErrorTake text_filed value in a variable using controller and views in railsLogin failure with Rails 5.1.2 and Devise 4.3.0 Completed 401 Unauthorized (user verified)Heroku and rails stuck at pg_try_advisory_lock()
MH370 blackbox - is it still possible to retrieve data from it?
SPI Waveform on Raspberry Pi Not clean and I'm wondering why
What is the line crossing the Pacific Ocean that is shown on maps?
A player is constantly pestering me about rules, what do I do as a DM?
Does the UK have a written constitution?
How should I behave to assure my friends that I am not after their money?
Intuitively, why does putting capacitors in series decrease the equivalent capacitance?
Generate and graph the Recamán Sequence
Disabling automatic add after resolving git conflict
Professor Roman gives unusual math quiz ahead of
What are good ways to spray paint a QR code on a footpath?
Why isn’t the tax system continuous rather than bracketed?
Confusion about multiple information Sets
can’t run a function against EXEC
What shortcut does ⌦ symbol in Camunda macOS app indicate and how to invoke it?
Do we or do we not observe (measure) superpositions all the time?
What's the point of DHS warning passengers about Manila airport?
What is the best delay to use between characters sent to the serial port
Do I have to roll to maintain concentration if a target other than me who is affected by my concentration spell takes damage?
Three column layout
If a high rpm motor is run at lower rpm, will it produce more torque?
Are there any vegetarian astronauts?
Does anycast addressing add additional latency in any way?
Dold-Kan correspondence in the category of symmetric spectra
how to return values in json that contain models to be associated using JBuilder
How can I “pretty” format my JSON output in Ruby on Rails?How to check whether a string contains a substring in Ruby?can't convert nil into an exact numberCalling attributes of an associated model in the viewRender html partial in JSON JBuilderModel with custom table name return values of other typeRails 4: nested attributes and PG::NotNullViolation ErrorTake text_filed value in a variable using controller and views in railsLogin failure with Rails 5.1.2 and Devise 4.3.0 Completed 401 Unauthorized (user verified)Heroku and rails stuck at pg_try_advisory_lock()
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I would like to return values in json that contain models to be associated using JBuilder.
But I don’t know how to do it. And I encounter the error that “undefined method xx”
Here is my setting of rails.
Model
app/models/item.rb
belongs_to :user
app/models/user.rb
include UserImageUploader[:image]
has_many :item
vim app/uploaders/user_image_uploader.rb
# MiniMagick
require 'image_processing/mini_magick'
class UserImageUploader < Shrine
include ImageProcessing::MiniMagick
# The determine_mime_type plugin allows you to determine and store the actual MIME type of the file analyzed from file content.
plugin :determine_mime_type
plugin :store_dimensions
plugin :pretty_location
plugin :processing
plugin :recache
#The versions plugin enables your uploader to deal with versions,
#by allowing you to return a Hash of files when processing.
plugin :versions
process(:store) do |io, context|
original = io.download
thumbnail = ImageProcessing::MiniMagick
.source(original)
.resize_to_limit!(600, nil)
original.close!
original: io, thumbnail: thumbnail
end
#plugin :versions
#plugin :delete_promoted
#plugin :delete_raw
end
items_controller.rb
@items = Item.includes(:user).page(params[:page] ||= 1).per(8).order('created_at DESC')
render 'index', formats: 'json', handlers: 'jbuilder'
Item/index.json.jbuilder
json.array! @items do |t|
json.id t.id //get the value normally
json.created_at t.created_at //get the value normally
Json.user_id t.user.id //undefined method `id’
json.user_original_img t.user.image_url(:original) //undefined method `image_url'
end
As above, I could not get the value of the model being associated.
By the way, I could check the value correctly with rails console.
Bundle exec rails c
Item.first.user.image_url(:original)
Item Load (1.5ms) SELECT `items`.* FROM `items` ORDER BY `items`.`id` ASC LIMIT 1
User Load (0.7ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
=> "https://xx.s3.ap-northeast-1.amazonaws.com/store/user/1/image/original-xx”
Item.first.user.id
(19.0ms) SET NAMES utf8mb4, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
Item Load (0.9ms) SELECT `items`.* FROM `items` ORDER BY `items`.`id` ASC LIMIT 1
User Load (0.8ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
=> 1
Let me know what points I am wrong with.
Thank you for reading my question.
ruby-on-rails ruby jbuilder
add a comment |
I would like to return values in json that contain models to be associated using JBuilder.
But I don’t know how to do it. And I encounter the error that “undefined method xx”
Here is my setting of rails.
Model
app/models/item.rb
belongs_to :user
app/models/user.rb
include UserImageUploader[:image]
has_many :item
vim app/uploaders/user_image_uploader.rb
# MiniMagick
require 'image_processing/mini_magick'
class UserImageUploader < Shrine
include ImageProcessing::MiniMagick
# The determine_mime_type plugin allows you to determine and store the actual MIME type of the file analyzed from file content.
plugin :determine_mime_type
plugin :store_dimensions
plugin :pretty_location
plugin :processing
plugin :recache
#The versions plugin enables your uploader to deal with versions,
#by allowing you to return a Hash of files when processing.
plugin :versions
process(:store) do |io, context|
original = io.download
thumbnail = ImageProcessing::MiniMagick
.source(original)
.resize_to_limit!(600, nil)
original.close!
original: io, thumbnail: thumbnail
end
#plugin :versions
#plugin :delete_promoted
#plugin :delete_raw
end
items_controller.rb
@items = Item.includes(:user).page(params[:page] ||= 1).per(8).order('created_at DESC')
render 'index', formats: 'json', handlers: 'jbuilder'
Item/index.json.jbuilder
json.array! @items do |t|
json.id t.id //get the value normally
json.created_at t.created_at //get the value normally
Json.user_id t.user.id //undefined method `id’
json.user_original_img t.user.image_url(:original) //undefined method `image_url'
end
As above, I could not get the value of the model being associated.
By the way, I could check the value correctly with rails console.
Bundle exec rails c
Item.first.user.image_url(:original)
Item Load (1.5ms) SELECT `items`.* FROM `items` ORDER BY `items`.`id` ASC LIMIT 1
User Load (0.7ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
=> "https://xx.s3.ap-northeast-1.amazonaws.com/store/user/1/image/original-xx”
Item.first.user.id
(19.0ms) SET NAMES utf8mb4, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
Item Load (0.9ms) SELECT `items`.* FROM `items` ORDER BY `items`.`id` ASC LIMIT 1
User Load (0.8ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
=> 1
Let me know what points I am wrong with.
Thank you for reading my question.
ruby-on-rails ruby jbuilder
1
You've cut the error message into halve, what does the last bit say? "NameError: undefined local variable or method `id' for ........."
– 3limin4t0r
Mar 25 at 12:41
add a comment |
I would like to return values in json that contain models to be associated using JBuilder.
But I don’t know how to do it. And I encounter the error that “undefined method xx”
Here is my setting of rails.
Model
app/models/item.rb
belongs_to :user
app/models/user.rb
include UserImageUploader[:image]
has_many :item
vim app/uploaders/user_image_uploader.rb
# MiniMagick
require 'image_processing/mini_magick'
class UserImageUploader < Shrine
include ImageProcessing::MiniMagick
# The determine_mime_type plugin allows you to determine and store the actual MIME type of the file analyzed from file content.
plugin :determine_mime_type
plugin :store_dimensions
plugin :pretty_location
plugin :processing
plugin :recache
#The versions plugin enables your uploader to deal with versions,
#by allowing you to return a Hash of files when processing.
plugin :versions
process(:store) do |io, context|
original = io.download
thumbnail = ImageProcessing::MiniMagick
.source(original)
.resize_to_limit!(600, nil)
original.close!
original: io, thumbnail: thumbnail
end
#plugin :versions
#plugin :delete_promoted
#plugin :delete_raw
end
items_controller.rb
@items = Item.includes(:user).page(params[:page] ||= 1).per(8).order('created_at DESC')
render 'index', formats: 'json', handlers: 'jbuilder'
Item/index.json.jbuilder
json.array! @items do |t|
json.id t.id //get the value normally
json.created_at t.created_at //get the value normally
Json.user_id t.user.id //undefined method `id’
json.user_original_img t.user.image_url(:original) //undefined method `image_url'
end
As above, I could not get the value of the model being associated.
By the way, I could check the value correctly with rails console.
Bundle exec rails c
Item.first.user.image_url(:original)
Item Load (1.5ms) SELECT `items`.* FROM `items` ORDER BY `items`.`id` ASC LIMIT 1
User Load (0.7ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
=> "https://xx.s3.ap-northeast-1.amazonaws.com/store/user/1/image/original-xx”
Item.first.user.id
(19.0ms) SET NAMES utf8mb4, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
Item Load (0.9ms) SELECT `items`.* FROM `items` ORDER BY `items`.`id` ASC LIMIT 1
User Load (0.8ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
=> 1
Let me know what points I am wrong with.
Thank you for reading my question.
ruby-on-rails ruby jbuilder
I would like to return values in json that contain models to be associated using JBuilder.
But I don’t know how to do it. And I encounter the error that “undefined method xx”
Here is my setting of rails.
Model
app/models/item.rb
belongs_to :user
app/models/user.rb
include UserImageUploader[:image]
has_many :item
vim app/uploaders/user_image_uploader.rb
# MiniMagick
require 'image_processing/mini_magick'
class UserImageUploader < Shrine
include ImageProcessing::MiniMagick
# The determine_mime_type plugin allows you to determine and store the actual MIME type of the file analyzed from file content.
plugin :determine_mime_type
plugin :store_dimensions
plugin :pretty_location
plugin :processing
plugin :recache
#The versions plugin enables your uploader to deal with versions,
#by allowing you to return a Hash of files when processing.
plugin :versions
process(:store) do |io, context|
original = io.download
thumbnail = ImageProcessing::MiniMagick
.source(original)
.resize_to_limit!(600, nil)
original.close!
original: io, thumbnail: thumbnail
end
#plugin :versions
#plugin :delete_promoted
#plugin :delete_raw
end
items_controller.rb
@items = Item.includes(:user).page(params[:page] ||= 1).per(8).order('created_at DESC')
render 'index', formats: 'json', handlers: 'jbuilder'
Item/index.json.jbuilder
json.array! @items do |t|
json.id t.id //get the value normally
json.created_at t.created_at //get the value normally
Json.user_id t.user.id //undefined method `id’
json.user_original_img t.user.image_url(:original) //undefined method `image_url'
end
As above, I could not get the value of the model being associated.
By the way, I could check the value correctly with rails console.
Bundle exec rails c
Item.first.user.image_url(:original)
Item Load (1.5ms) SELECT `items`.* FROM `items` ORDER BY `items`.`id` ASC LIMIT 1
User Load (0.7ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
=> "https://xx.s3.ap-northeast-1.amazonaws.com/store/user/1/image/original-xx”
Item.first.user.id
(19.0ms) SET NAMES utf8mb4, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
Item Load (0.9ms) SELECT `items`.* FROM `items` ORDER BY `items`.`id` ASC LIMIT 1
User Load (0.8ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
=> 1
Let me know what points I am wrong with.
Thank you for reading my question.
ruby-on-rails ruby jbuilder
ruby-on-rails ruby jbuilder
asked Mar 25 at 11:48
sukhosukho
1704 silver badges13 bronze badges
1704 silver badges13 bronze badges
1
You've cut the error message into halve, what does the last bit say? "NameError: undefined local variable or method `id' for ........."
– 3limin4t0r
Mar 25 at 12:41
add a comment |
1
You've cut the error message into halve, what does the last bit say? "NameError: undefined local variable or method `id' for ........."
– 3limin4t0r
Mar 25 at 12:41
1
1
You've cut the error message into halve, what does the last bit say? "NameError: undefined local variable or method `id' for ........."
– 3limin4t0r
Mar 25 at 12:41
You've cut the error message into halve, what does the last bit say? "NameError: undefined local variable or method `id' for ........."
– 3limin4t0r
Mar 25 at 12:41
add a comment |
2 Answers
2
active
oldest
votes
It seems that some items in @items
list, doesn't have associated user, or their user_id
field is nil
. Then item.user
would be nil
. When you do nil.image_url
you get NoMethodError: undefined method 'image_url' for nil:NilClass
.
You could add a foreign key constraint between Item
and User
in your migration, to avoid problems like this:
add_foreign_key :items, :users
NOTE:
Adding the foreign key would still allow empty values. You'd also have to add the following in your migration file to avoid empty values in user_id
column:
change_column_null :items, :user_id, false
Thanks to @3limin4t0r for pointing this out.
1
Adding the foreign key would still allow empty values. You'd also have to addchange_column_null :items, :user_id, false
(if not already present).
– 3limin4t0r
Mar 25 at 12:37
@3limin4t0r I got a hint from your answer and found casuse of the problem.
– sukho
Mar 25 at 13:01
The cause of the error was that nil was in some columns of user_id. thank you very much!
– sukho
Mar 25 at 13:03
add a comment |
app/models/user.rb
include UserImageUploader[:image]
has_many :item
should be has_many :items
, not terribly confident on this, but this may be the reason you're finding blank columns in your db. A has_many, belongs_to
relationship should default to required.
Thank you for your advice. I'll make change it
– sukho
Mar 26 at 11:15
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55337135%2fhow-to-return-values-in-json-that-contain-models-to-be-associated-using-jbuilder%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
It seems that some items in @items
list, doesn't have associated user, or their user_id
field is nil
. Then item.user
would be nil
. When you do nil.image_url
you get NoMethodError: undefined method 'image_url' for nil:NilClass
.
You could add a foreign key constraint between Item
and User
in your migration, to avoid problems like this:
add_foreign_key :items, :users
NOTE:
Adding the foreign key would still allow empty values. You'd also have to add the following in your migration file to avoid empty values in user_id
column:
change_column_null :items, :user_id, false
Thanks to @3limin4t0r for pointing this out.
1
Adding the foreign key would still allow empty values. You'd also have to addchange_column_null :items, :user_id, false
(if not already present).
– 3limin4t0r
Mar 25 at 12:37
@3limin4t0r I got a hint from your answer and found casuse of the problem.
– sukho
Mar 25 at 13:01
The cause of the error was that nil was in some columns of user_id. thank you very much!
– sukho
Mar 25 at 13:03
add a comment |
It seems that some items in @items
list, doesn't have associated user, or their user_id
field is nil
. Then item.user
would be nil
. When you do nil.image_url
you get NoMethodError: undefined method 'image_url' for nil:NilClass
.
You could add a foreign key constraint between Item
and User
in your migration, to avoid problems like this:
add_foreign_key :items, :users
NOTE:
Adding the foreign key would still allow empty values. You'd also have to add the following in your migration file to avoid empty values in user_id
column:
change_column_null :items, :user_id, false
Thanks to @3limin4t0r for pointing this out.
1
Adding the foreign key would still allow empty values. You'd also have to addchange_column_null :items, :user_id, false
(if not already present).
– 3limin4t0r
Mar 25 at 12:37
@3limin4t0r I got a hint from your answer and found casuse of the problem.
– sukho
Mar 25 at 13:01
The cause of the error was that nil was in some columns of user_id. thank you very much!
– sukho
Mar 25 at 13:03
add a comment |
It seems that some items in @items
list, doesn't have associated user, or their user_id
field is nil
. Then item.user
would be nil
. When you do nil.image_url
you get NoMethodError: undefined method 'image_url' for nil:NilClass
.
You could add a foreign key constraint between Item
and User
in your migration, to avoid problems like this:
add_foreign_key :items, :users
NOTE:
Adding the foreign key would still allow empty values. You'd also have to add the following in your migration file to avoid empty values in user_id
column:
change_column_null :items, :user_id, false
Thanks to @3limin4t0r for pointing this out.
It seems that some items in @items
list, doesn't have associated user, or their user_id
field is nil
. Then item.user
would be nil
. When you do nil.image_url
you get NoMethodError: undefined method 'image_url' for nil:NilClass
.
You could add a foreign key constraint between Item
and User
in your migration, to avoid problems like this:
add_foreign_key :items, :users
NOTE:
Adding the foreign key would still allow empty values. You'd also have to add the following in your migration file to avoid empty values in user_id
column:
change_column_null :items, :user_id, false
Thanks to @3limin4t0r for pointing this out.
edited Mar 25 at 13:43
answered Mar 25 at 12:06
Sajad RastegarSajad Rastegar
8672 gold badges14 silver badges26 bronze badges
8672 gold badges14 silver badges26 bronze badges
1
Adding the foreign key would still allow empty values. You'd also have to addchange_column_null :items, :user_id, false
(if not already present).
– 3limin4t0r
Mar 25 at 12:37
@3limin4t0r I got a hint from your answer and found casuse of the problem.
– sukho
Mar 25 at 13:01
The cause of the error was that nil was in some columns of user_id. thank you very much!
– sukho
Mar 25 at 13:03
add a comment |
1
Adding the foreign key would still allow empty values. You'd also have to addchange_column_null :items, :user_id, false
(if not already present).
– 3limin4t0r
Mar 25 at 12:37
@3limin4t0r I got a hint from your answer and found casuse of the problem.
– sukho
Mar 25 at 13:01
The cause of the error was that nil was in some columns of user_id. thank you very much!
– sukho
Mar 25 at 13:03
1
1
Adding the foreign key would still allow empty values. You'd also have to add
change_column_null :items, :user_id, false
(if not already present).– 3limin4t0r
Mar 25 at 12:37
Adding the foreign key would still allow empty values. You'd also have to add
change_column_null :items, :user_id, false
(if not already present).– 3limin4t0r
Mar 25 at 12:37
@3limin4t0r I got a hint from your answer and found casuse of the problem.
– sukho
Mar 25 at 13:01
@3limin4t0r I got a hint from your answer and found casuse of the problem.
– sukho
Mar 25 at 13:01
The cause of the error was that nil was in some columns of user_id. thank you very much!
– sukho
Mar 25 at 13:03
The cause of the error was that nil was in some columns of user_id. thank you very much!
– sukho
Mar 25 at 13:03
add a comment |
app/models/user.rb
include UserImageUploader[:image]
has_many :item
should be has_many :items
, not terribly confident on this, but this may be the reason you're finding blank columns in your db. A has_many, belongs_to
relationship should default to required.
Thank you for your advice. I'll make change it
– sukho
Mar 26 at 11:15
add a comment |
app/models/user.rb
include UserImageUploader[:image]
has_many :item
should be has_many :items
, not terribly confident on this, but this may be the reason you're finding blank columns in your db. A has_many, belongs_to
relationship should default to required.
Thank you for your advice. I'll make change it
– sukho
Mar 26 at 11:15
add a comment |
app/models/user.rb
include UserImageUploader[:image]
has_many :item
should be has_many :items
, not terribly confident on this, but this may be the reason you're finding blank columns in your db. A has_many, belongs_to
relationship should default to required.
app/models/user.rb
include UserImageUploader[:image]
has_many :item
should be has_many :items
, not terribly confident on this, but this may be the reason you're finding blank columns in your db. A has_many, belongs_to
relationship should default to required.
edited Mar 25 at 15:51
answered Mar 25 at 15:43
Richard LegacyRichard Legacy
816 bronze badges
816 bronze badges
Thank you for your advice. I'll make change it
– sukho
Mar 26 at 11:15
add a comment |
Thank you for your advice. I'll make change it
– sukho
Mar 26 at 11:15
Thank you for your advice. I'll make change it
– sukho
Mar 26 at 11:15
Thank you for your advice. I'll make change it
– sukho
Mar 26 at 11:15
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55337135%2fhow-to-return-values-in-json-that-contain-models-to-be-associated-using-jbuilder%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
You've cut the error message into halve, what does the last bit say? "NameError: undefined local variable or method `id' for ........."
– 3limin4t0r
Mar 25 at 12:41