Displaying 2 results from an estimated 2 matches for "end_tag".
Did you mean:
d_tag
2012 Sep 30
3
How to escape a forward slash with gsub, also does interpolation work with gsub?
...''m trying:
text.gsub(//* start */(.*)/* end *//im, replace_with)
But i''m getting errors relating to expecting keyword_end.
How should I be escaping /* and */ ?
Also, does string interpolation work in gsub regex? Say I had variables
like:
start_tag = "/* start */"
end_tag = "/* end */"
I want to do:
text.gsub("#{start_tag}(.*)#{end_tag}", replace_with)
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G...
2008 Apr 19
1
form_for question
I have a following snippt to make a form.
<% form_for :post, @post, :url => { :action => "create" } do |f| -%>
<%- end ->
What does ":post" and "@post" do respectively?
If my understanding is correct, @post is there because I set "@post =
Post.new" in the action. But I don''t know what ":post " is for.
Tek