ruby - passing chained scopes as params on rails 3? -


मेरे पास यह मेरे विचार पर है:

  & lt;% = link_to "शर्ट" Things_ path (: scope = & gt; "शर्ट")% & gt;   

यह मेरे नियंत्रक पर

  @products = Product.send (params [: scope])   

हालांकि मैं श्रृंखलित स्कोप का प्रयोग करना चाहता हूं जैसे:

  & lt;% = link_to "शर्ट", products_path (: scope = & gt; "shirts.blue")% & gt;   

लेकिन किसी कारण से यह काम नहीं करता।

शायद मेरी वाक्यविन्यास गलत है?

इसे आज़माएं

  & lt;% = link_to" शर्ट ", products_path (: scope = & gt;" shirts.blue ")% & gt;   

मॉडल

  @products = उत्पादकैड पैरामीटर [: गुंजाइश] .split ("।")। प्रत्येक {| गुंजाइश | @ प्रोडक्ट्स = @ उत्पादों.send (स्कोप)}    

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -