Here I found a similar Rails 3 link_to question inside a line , but for some reason does not work for my script.
I have an object @matterthat has a url as shown below.
@matter = url_for(:controller => 'news', :action => 'news_view',:id => @news.token)
I'm trying to put this link inside the text, which can be done by simply placing "# {@matter}". But I want to put the alias of this entire link generated as "VIEW NEWS", and when the user clicks on it, it is redirected to the original url.
Using this, I must send both my mail and mobile text to my link. I received it by e-mail, but could not do this to send text, as it :bodyrequires a string format for the message API.
I followed the aforementioned SO post, but they don't work for me at all.
"\"#{@news.sender.first_name} #{@news.sender.last_name} just sent you a invite.\" Click on link raw('<%= link_to 'View Invite', @method) %>') ")
I agree with the use of html inside the string, for example <a href ="#{@matter}", view invite </a>, if possible.
Help Wanted.
I use twilio to send text using below API.
@client = Twilio::REST::Client.new @account_sid, @auth_token
@client.account.messages.create(:from => '+123456789', :to => '+1'+@phone,
:body => "#{@matter}" )