Hello all I am very new to the ruby on rails. I am currently working on a survey project and I would like to store the survey questions with form elements in a database. I have been successful with adding the basic html code needed to display the question, however the rails tags <% %> are not being executed. Is there a way to force the execution of these tags when they are passed back from the database? Thanks to all Jeffrey Newman Web Developer Mindshare Interactive Campaigns, L.L.C. Ph 202.521.4435 / Fax 202.654.0839 www.mindshare.net <http://www.mindshare.net/> _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
You should really let people store ruby in a database, there are some nasty people out there that would exploit it. I would look at <a href="http://home.leetsoft.com/liquid">Liquid</a>, from the creator of Typo.There is a <a href+"http://leetsoft.com/rails/liquid-installation.mov">Moview</a> This seems like a better solution. Here To Help Joey__
> I am very new to the ruby on rails. I am currently working on a survey > project and I would like to store the survey questions with form elements in > a database. I have been successful with adding the basic html code needed > to display the question, however the rails tags <% %> are not being > executed. Is there a way to force the execution of these tags when they are > passed back from the database?Show me the code that''s not working, and what you expect it to do and I''ll try to give you a hand with it. You can reach me on IRC as srbaker most of the day (in PST), too. -Steven
Hi Steve The problem is I used capture to create a instance variable for the form or survey question that is stored in the database when I display the variable <%=@display_question %> Rails renders the html in the file but for some reason erb is not executing the ruby inside the delimiters i.e ruby variables that returned form the database or form methods used to short cut form fields in rails. Have any ideas how I can get erb to correctly evaluate and execute the ruby code. Thanks for your time Jeff Newman On Nov 30, 2005, at 5:02 PM, Steven R. Baker wrote:>> I am very new to the ruby on rails. I am currently working on a >> survey >> project and I would like to store the survey questions with form >> elements in >> a database. I have been successful with adding the basic html >> code needed >> to display the question, however the rails tags <% %> are not being >> executed. Is there a way to force the execution of these tags >> when they are >> passed back from the database? > > Show me the code that''s not working, and what you expect it to do and > I''ll try to give you a hand with it. > > You can reach me on IRC as srbaker most of the day (in PST), too. > > -Steven > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
jeffn05 wrote:> Hi Steve > > The problem is I used capture to create a instance variable for the > form or survey question that is stored in the database when I display > the variable <%=@display_question %> Rails renders the html in the > file but for some reason erb is not executing the ruby inside the > delimiters i.e ruby variables that returned form the database or form > methods used to short cut form fields in rails. > > Have any ideas how I can get erb to correctly evaluate and execute > the ruby code. > > Thanks for your time > > JeffYou need to call a form of the "render" function on this text. -- Posted via http://www.ruby-forum.com/.
Thanks to All and Steve I was able to use <%= render :inline => @display_question %>. One not about doing this make sure the code your are posting in the database is 100% syntax correct otherwise the proram will throw an application error. Offn05 wrote:>> Hi Steve >> >> The problem is I used capture to create a instance variable for the >> form or survey question that is stored in the database when I display >> the variable <%=@display_question %> Rails renders the html in the >> file but for some reason erb is not executing the ruby inside the >> delimiters i.e ruby variables that returned form the database or form >> methods used to short cut form fields in rails. >> >> Have any ideas how I can get erb to correctly evaluate and execute >> the ruby code. >> >> Thanks for your time >> >> Jeff > > You need to call a form of the "render" function on this text. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails