Created
April 11, 2014 01:41
-
-
Save attatae/10436529 to your computer and use it in GitHub Desktop.
profiles controller snippet.rb
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 index | |
if params[:interest] | |
@profiles = Profile.tagged_with(params[:interest], :on => :interests) | |
else | |
@profiles = Profile.all | |
end | |
if params[:skill] | |
@profiles = Profile.tagged_with(params[:skill], :on => :skills) | |
else | |
@profiles = Profile.all | |
end | |
end |
Thanks for helping with the code, @ballman. The earlier error is gone (scoping in tag cloud works); However, now when I click on "edit", the :interest and :skill tags do not show up. I can make a new profile, see :interests and :skills just fine on the Show page, but when I click to Edit the same profile, those :interests and :skills are not visible. I was't getting this error before.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you are overwriting the @Profile when you pass only an :interest param. I'm assuming that only one of the :skill or :interest parameters will be sent at once, so the code should be: