-
-
Save cernalpanic/80fa36ebd280f079ae2b to your computer and use it in GitHub Desktop.
Everything until line 7 works. I want [context] to be 'appkeys'. #this one works
bundle.appkeys << dropped #this one doesn't bundle[context] << dropped I get this error:
NoMethodError: undefined method `<<' for #<Bundle:0x007fe7addcca20>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ajax_add_to_bundle | |
#params = { bundle_id: 1, droppedid: 1, context: 'appkey' } | |
bundle = Bundle.find(params[:bundle_id]) | |
context = params[:context] | |
droppedid = params[:droppedid] | |
dropped = eval(context).find(droppedid) | |
bundle[context] << dropped | |
bundle.save | |
render :nothing => true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment