Questions tagged [rhtml]

HTML-files, with ruby code embedded.

HTML-files, with ruby code embedded, similar to [JSP].

RHTML is HTML mixed with Ruby, using HTML tags. All of Ruby is available for programming alongwith HTML:

Following is the syntax of using Ruby with HTML:

<% %> # executes the Ruby code <%= %> # executes the Ruby code and displays the result

The output of anything in <%= %> tags is directly copied to the HTML output stream. To secure against HTML injection, use the h() function to html_escape the output

For example::

30 questions
48
votes
1 answer

What is the difference between .erb , .rhtml and .html.erb?

What is the difference between .erb, .rhtml and .html.erb?
sameera207
  • 16,117
  • 18
  • 81
  • 143
5
votes
0 answers

knitr: local function cannot be found when converting markdown file into html

Hi I am using R studio and the "knitHTML" button to convert my Rmd file into a html file. However, even thought the code runs fine, when using knitHTML it cannot find any of my local function created: Error:Couldnot find function "xxx"…
Krish Mahajan
  • 243
  • 3
  • 6
5
votes
4 answers

What are some tips for debugging Ruby erb files?

Currently, when I get an error on an erb template (for use with HTTPServer/cgi) I do the following: If it's a small change, revert, save and retest. For a large change or new file, delete or comment 1/2 the code, and retest. Perform a binary…
brianegge
  • 26,898
  • 12
  • 70
  • 97
4
votes
4 answers

How to access html request parameters for a .rhtml page served by webrick?

I'm using webrick (the built-in ruby webserver) to serve .rhtml files (html with ruby code embedded --like jsp). It works fine, but I can't figure out how to access parameters (e.g. http://localhost/mypage.rhtml?foo=bar) from within the ruby code in…
cibercitizen1
  • 19,104
  • 14
  • 65
  • 90
3
votes
2 answers

RHTML displaying HTML tags on output

I have an RHTML view in Rails, where the output is coming from my MongoDB collection. The data is outputted correctly using an iteration block, but whenever I try and have HTML tags in my database, they are not rendered in the HTML output, instead…
Scott Nicol
  • 10,038
  • 3
  • 13
  • 8
3
votes
1 answer

Search box in network Plot

I have created a Network of protein mutations using the forceNetwork() function of the networkD3 package. It get's rendered on the RStudio's "Viewer" pane. I can then save this as an HTML file, for sharing, with the dynamic nature (like clicking…
Syamanthaka
  • 867
  • 1
  • 8
  • 18
3
votes
1 answer

Rendering a variable with erb

I've got the following problem: I have rhtml (html minced together with ruby inside <% %> and <%= %> tags) stored in a database which I want to render. The information is acquired through a query. I need to be able to evaluate the information I get…
TZer0
  • 53
  • 1
  • 6
2
votes
1 answer

Using CGI to run a script

first time posting :) I am doing an exercise in Ruby and i am a little stuck with the CGI method. I used the HTML code below to send the form's input. Bit from HTML
:…
TLP
  • 89
  • 7
2
votes
3 answers

Radio Button won't work in internet explorer but works fine in firefox

I have HTML code like so: function toggle_action(type) { var tabs = document.getElementsByName("action_tab") for(var i = 0 ; i < tabs.length; i++){ //alert(" i = " + i + " length=" + tabs.length ); if(tabs[i].id == type.value){ …
Mo.
  • 33,074
  • 32
  • 81
  • 126
2
votes
0 answers

Scraping with RHTMLForms: "Could not resolve host : NA"

I'm trying to scrape data from http://www.federalreserve.gov/apps/mdrm/data-dictionary using R package RHTMLForms. I can successfully fill out and submit the first form but, in the cases where there is a second form (e.g., if you search for series…
sirallen
  • 1,839
  • 12
  • 20
1
vote
1 answer

2 User-defined classes for 1 model in Rails

Is it possible to create one model that stands for two different objects? for example: I have a blog, on which, I will publish articles on pure text and screencasts with only video. With that in mind: I want to get only all posts => @posts =…
Nicos Karalis
  • 3,547
  • 4
  • 28
  • 59
1
vote
1 answer

how to configure tomcat to handle rhtml pages using jruby?

How can I configure tomcat to handle .rhtml pages with jruby? I guess I should mess around with the web.xml file, but I don't know how... (ideally, without rails, just the necessary stuff to use erb for rendering rhtml pages...)
opensas
  • 52,870
  • 69
  • 227
  • 340
1
vote
0 answers

IE suddenly not allowing cross-site document.write?

Our site has several affiliates that use a JavaScript widget to display the latest content available in an ad space. It's all JavaScript powered. The insert the script in the right place, and our rails app generates some rhtml to get inserted. On…
1
vote
1 answer

ruby ERB compare dates

I have a site that uses ruby (rhtml) files which I am not used to editing (more used to php). I only have access to these files to edit (so not the back-end). In the database I have a date that I can display using: <%= zp.date %> which will display…
Phil
  • 27
  • 8
1
vote
5 answers

How do can I have a dropdown list(select HTML) where i want to have one of the options where i allow the user to enter a user specif entery?

I want to have a drop down menu where a user can select from several predefined options but i also want to give him the option of inserting a user specific value, i was thinking having one of the options as "user specific" which will in turn allow…
Mo.
  • 33,074
  • 32
  • 81
  • 126
1
2