请考虑这个例子:
- user_links_params = _user_link_params(current_user) %a{ :'data-msgstore-path' => user_links_params[:'data-msgstore-path'],:'data-user_id' => user_links_params[:'data-user_id'],:class => user_links_params[:class],} / too many html tags and stuff to fit in a simple link_to
我很乐意将所有这些都放在一个简单的语句中,如下所示:
%a[_user_link_params(current_user)] / too many html tags and stuff to fit in a simple link_to
解决方法
是的,这是可能的,你很亲密:
%a{_user_link_params(current_user)}
For example,if you defined
06001
then
%sandwich{hash1,hash2,:delicIoUs => true}/
would compile to:06002