views:

38

answers:

1

In my edit.haml file, I have =render :partial => 'old_question_tags', :locals => {:current_question => @question.id}.

I'd like to pass the value in :current_question to a link_to_remote call in _old_question_tags.haml:

#{link_to_remote image_tag('red-x.png', {:alt => "Remove #{t.name} tag"}), :url => {:action => 'remove_old_tag_from_question', :tag_remove => t.id, :current_question => current_question}}

But I get this error on the link_to_remote line:

ActionView::TemplateError (undefined local variable or method `current_question' for #<ActionView::Base:0xdb2fec8>)

In _old_question_tags.haml, if I just print current_question (using =current_question), it prints the number without any problems.

How do I properly pass that value to the partial so that I can pass it to the link_to_remote call?

A: 

If you write

:question => current_question

will it work?

True Soft
In link_to_remote? Nooope, I get the same error. >_> Perhaps I'm not passing multiple parameters in link_to_remote correctly?
Teef L
I see that `:current_question => current_question` is in `:url` not in `link_to_remote`. What is the url link you get if you write only `:url => {:action => 'remove_old_tag_from_question', :tag_remove => t.id}`?
True Soft