I have a .rhtml file and there are many condition checks like this <% if @mime_partial %> This condition is used before using html tags.
I’m working on action mailer. I’m redesigning the view, the code is written by my friend. In the browser one can click the button to “send email”.
The variable @mime_partial is defined no where. I thought it’s an internal thing of Rails.
What is the significance of this mime_partial?
Thanks in advance.
EDIT:
I used grep and got this:
xyz.merge!(:mime_partial => true, .... )
It has never been set to false, then why are they using if condition on it?
Answer:
I found out the answer.
this @mime_partial corresponds to mailer. When I render the view in browser, it will be controlled by controller not mailer, so @mime_partial will be false.
When I render the content by sending email, then in email the @mime_partial will be set to true, because it is controlled by mailer not controller. Then it will render some new contents which were inside the if condition.
thanks for the support.
Most probably your controller is creating this instance variable. You may grep your sources and see where this variable is used.
I don’t see this variable in Rails 1.x sources, so I believe it is something specific to your application. But it may be, that this variable is created by some gem or plugin.