Slim Template Based Views

38 views
Skip to first unread message

zjuna...@gmail.com

unread,
Aug 3, 2015, 7:18:22 PM8/3/15
to Fat Free CRM Developers
I am using FatfreeCRm and customizing it. The guys I work for uses Slim and the project we took over has views done in HAML.  I installed `slim-rails` gem and converted on view to Slim. What I noticed is that the hooks don't get rendered.

FFCRM is mounted as an engine.

Has any one  used FFCRM with Slim? What steps do I need to follow to use slim in the application.

Ex:

- if (template = template_for_current_view)
| list
= render(template, :account => @account)
- else

/ default view

= styles_for :task, :contact, :opportunity, :lead, :invoice

= render 'accounts/title_bar', :account => @account

div#edit_account

= render "comments/new", :commentable => @account
= render :partial => "shared/timeline", :collection => @timeline
| Before hook
= hook(:show_account_bottom, self, {entity: @account}) do
| Inside hook
= render :partial => "tasks/tasks", :locals => {:object => @account}

= render partial: "contacts/contacts", :object => @account

= render "leads/leads", :object => @account

= render "opportunities/opportunities", :object => @account

- if @account.supplier?
= render "invoices/invoices", collection: @bills, category: 'bills'

= render "invoices/invoices", collection: @invoices, category: 'invoices'

= render "versions/versions", :object => @account

= load_select_popups_for(@account, :tasks, :contacts, :opportunities)

Steve Kenworthy

unread,
Aug 4, 2015, 2:21:57 AM8/4/15
to fat-free...@googlegroups.com
I've not used slim before so I'm not sure how it works but for FFCRM, the hooks are basically registerable template helpers that are called when the template is rendered.


Perhaps the slim template architecture is not seeing the function or calling it? You might want to put a debug statement in the line above to see if it's actually being called when the template is rendered. Are you getting any error messages?

Regards,
Steve

--
You received this message because you are subscribed to the Google Groups "Fat Free CRM Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fat-free-crm-d...@googlegroups.com.
To post to this group, send email to fat-free...@googlegroups.com.
Visit this group at http://groups.google.com/group/fat-free-crm-dev.
For more options, visit https://groups.google.com/d/optout.

Ziyan Junaideen

unread,
Aug 6, 2015, 10:18:54 AM8/6/15
to Fat Free CRM Developers
I will give it a try. I actually reverted to use Haml. I will keep things posted and dig in  to see and if I find some thing will post here or make an issue in the Github repo.

Thanks.
Reply all
Reply to author
Forward
0 new messages