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.

Adler Hsieh
  • 477
  • 3
  • 10
pavitra
  • 19
  • 5

1 Answers1

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.

Community
  • 1
  • 1
Adler Hsieh
  • 477
  • 3
  • 10
  • 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 06 '14 at 06:41