2

I am new in Ruby on rails and facing issue while creating link_to using Liquid gem. I want to create a link in the email template like:

{{link_to 'Submit', profile_accounts_url(:account_id => account.id)}} 

However, link is not created in email template. Please help me. Thanks in advance.

1 Answer 1

0

I didn't use liquied before, but you can check the syntax for link_to here.

using Liquid variables inside of a liquid tag call

http://richonrails.com/articles/liquid-templating-engine

However, I think you're using rails' syntax for link_to instead of liquid's syntax. Maybe you should just use something like:

<%= link_to "Submit", profile_accounts_path(account) %>

which will redirect to the show page.

1
  • Hi Adler, thanks for your help. I solved the problem by using this code..<% link = link_to 'Submit', profile_accounts_url(:account_id => @account.id) %> <%= @template.render('LINK' => link).html_safe %> in html.erb....and by putting this {{LINK}} in my email template
    – pavitra
    Oct 6, 2014 at 6:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.