Hi all, I have a table like the one below called key_value_pairs
id spec val 1 size small 2 size medium 3 size small
In my controller i have
def edit @pair = KeyValuePair.find(params[:id]) end
and in my view i have such code as <%= @pair.val %>.
This code was all working as expected before (before what i'm not sure, but now it no longer works) as far as im aware i have made no changes to the edit method in the controller or any changes to the view and all the data is still in the database table but now when i try and view the page i get nil object error message
You have a nil object when you didn't expect it! The error occurred while evaluating nil.val
Does any one have any suggestions or ideas? has this happened to anyone else?
I am not sure how to proceed as all my code (which is rather simple) looks like it should work.