I have a problem with saving an object instance of class Group to database
Please help me to understand where is the problem
here is model
class User < ActiveRecord::Base
has_many :groups
end
class Group < ActiveRecord::Base
belongs_to :user
has_many :people
end
and routes.rb
resources :users do |user|
resources :groups do |group|
resources :people
end
end
I use Devise to build User model and authenication system
use case: User signs up and now he/she is allowed to create groups.
if user is not signed up and logged in, creating groups is not allowed.
This part works.
Then the user goes to new_user_group_path, fills the form and clicks create.
At this moment page refreshes and I see the same form(empty) and url with all params that the form was populated on the previos step. Like this users/user_id/groups/new?utf8=✓&authenticity_token=...
at the same time list at user_groups_path doesn't show any new objects
here are controllers for Group
class GroupsController < ApplicationController
respond_to :html, :xml, :json
before_filter :authenticate_user!
def new
#user = current_user
#group = #user.groups.build(:user_id => current_user.id,
:location=>params[:group][:location])
respond_with(#group)
end
def create
#user = current_user
#group = #user.groups.build(:user_id => current_user.id,
:location=>params[:group][:location])
if #group.save
redirect_to user_groups_path(current_user)
else
render 'new'
end
end
here is the form
<%= form_for #group, :url => user_groups_path(:user_id => current_user.id) do |f| %>
<% if #group.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(#group.errors.count, "error") %> prohibited this group from being saved:</h2>
<ul>
<% #group.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<%= f.label :location %>
<%=f.text_field :location %>
<etc...>
<% end %>
UPD the result of rake routes
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session GET /users/sign_out(.:format) devise/sessions#destroy
user_password POST /users/password(.:format) devise/passwords#create
new_user_password GET /users/password/new(.:format) devise/passwords#new
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
PUT /users/password(.:format) devise/passwords#update
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel
user_registration POST /users(.:format) devise/registrations#create
new_user_registration GET /users/sign_up(.:format) devise/registrations#new
edit_user_registration GET /users/edit(.:format) devise/registrations#edit
PUT /users(.:format) devise/registrations#update
DELETE /users(.:format) devise/registrations#destroy
user_groups GET /users/:user_id/groups(.:format) groups#index
POST /users/:user_id/groups(.:format) groups#create
new_user_group GET /users/:user_id/groups/new(.:format) groups#new
edit_user_group GET /users/:user_id/groups/:id/edit(.:format) groups#edit
user_group GET /users/:user_id/groups/:id(.:format) groups#show
PUT /users/:user_id/groups/:id(.:format) groups#update
DELETE /users/:user_id/groups/:id(.:format) groups#destroy
users GET /users(.:format) users#index
POST /users(.:format) users#create
new_user GET /users/new(.:format) users#new
edit_user GET /users/:id/edit(.:format) users#edit
user GET /users/:id(.:format) users#show
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
db is sqlite3
where am I wrong?
appreciate any help
UPD
here is HTML that generates on /users/:user_id/groups/new page:
<!DOCTYPE html>
<html>
<head>
<title>PR0124</title>
<link href="/assets/bootstrap.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/javascripts/bootstrap.min.js" type="text/javascript"></script>
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.stepy/js/jquery.min.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.stepy/js/jquery.stepy.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.stepy/js/jquery.stepy.min.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.stepy/js/jquery.validate.min.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.stepy/test/lib/jasmine-html.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.stepy/test/lib/jasmine-jquery.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.stepy/test/lib/jasmine.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.stepy/test/spec.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap.min.js?body=1" type="text/javascript"></script>
<meta content="authenticity_token" name="csrf-param" />
<meta content="/l/wVZh+Tr/+WZbn5l5oJ7wQY1mU8kj0vyA61q1Bghw=" name="csrf-token" />
</head>
<body>
<div class='container'>
<form id='newgroup'>
<h1>Create a new group</h1>
<form accept-charset="UTF-8" action="/users/39/groups" class="new_group" id="new_group" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="/l/wVZh+Tr/+WZbn5l5oJ7wQY1mU8kj0vyA61q1Bghw=" /></div>
<fieldset id=”1”>
<div class="field">
<label id=location>Location</label>
<input class="input-xlarge" id="group_location" name="group[location]" placeholder="Type here" required="required" size="30" type="text" value="mnjsjksjkl" />
</div>
</fieldset>
<fieldset id=”2”>
<div class="field">
<label id='name'>Name</label>
<input class="input-xlarge" id="group_name" name="group[name]" placeholder="Type here" required="required" size="30" type="text" value="hjhjggh" />
</div>
</fieldset>
<fieldset id=”3”>
<input name="group[leader]" type="hidden" value="0" /><input id="group_leader" name="group[leader]" style="float:left; margin-right:9px" type="checkbox" value="1" />
<label for="group_leader">has a leader</label><br />
</fieldset>
<!-- Action button -->
<div class="actions">
<input class="btn btn-large" name="commit" type="submit" value="Create a Group" />
</div>
</form>
</form>
</div>
<script type="text/javascript">
$('#newgroup').stepy();
</script>
</body>
</html>
Here is development.log
Started GET "/users/39/group/new?utf8=%E2%9C%93&authenticity_token=%2Fl%2FwVZh%2BTr%2F%2BWZbn5l5oJ7wQY1mU8kj0vyA61q1Bghw%3D&group%5Blocation%5D=mnjsjksjkl&group%5Bname%5D=hjhjggh&group%5Bleader%5D=0&commit=has+a+leader" for 127.0.0.1 at 2013-08-22 03:03:30 +0400
Processing by GroupsController#new as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"/l/wVZh+Tr/+WZbn5l5oJ7wQY1mU8kj0vyA61q1Bghw=", "group"=>{"location"=>"mnjsjksjkl", "name"=>"hjhjggh", "leader"=>"0"}, "commit"=>"Create a group", "user_id"=>"39"}
[1m[35mUser Load (0.3ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 39 LIMIT 1
Rendered groups/_form.html.erb (2.2ms)
Rendered groups/new.html.erb within layouts/vertical (3.0ms)
Completed 200 OK in 32ms (Views: 29.2ms | ActiveRecord: 0.3ms)
Started GET "/assets/bootstrap.css?body=1" for 127.0.0.1 at 2013-08-22 03:03:30 +0400
Served asset /bootstrap.css - 304 Not Modified (0ms)
Rendered /usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.1ms)
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-08-22 03:03:30 +0400
Served asset /jquery.js - 304 Not Modified (0ms)
Started GET "/assets/javascripts/bootstrap.min.js" for 127.0.0.1 at 2013-08-22 03:03:30 +0400
Served asset /javascripts/bootstrap.min.js - 404 Not Found (3ms)
ActionController::RoutingError (No route matches [GET] "/assets/javascripts/bootstrap.min.js"):
actionpack (3.2.12) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.12) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.12) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.12) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.12) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.12) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.12) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.12) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.12) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.12) lib/rails/engine.rb:479:in `call'
railties (3.2.12) lib/rails/application.rb:223:in `call'
rack (1.4.5) lib/rack/content_length.rb:14:in `call'
railties (3.2.12) lib/rails/rack/log_tailer.rb:17:in `call'
rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
Rendered /usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.1ms)
Started GET "/assets/bootstrap.min.js?body=1" for 127.0.0.1 at 2013-08-22 03:03:30 +0400
Served asset /bootstrap.min.js - 304 Not Modified (0ms)
Started GET "/assets/jquery.stepy/js/jquery.min.js?body=1" for 127.0.0.1 at 2013-08-22 03:03:30 +0400
Served asset /jquery.stepy/js/jquery.min.js - 304 Not Modified (0ms)
Started GET "/assets/jquery.stepy/js/jquery.stepy.js?body=1" for 127.0.0.1 at 2013-08-22 03:03:30 +0400
Served asset /jquery.stepy/js/jquery.stepy.js - 304 Not Modified (0ms)
Started GET "/assets/jquery.stepy/js/jquery.stepy.min.js?body=1" for 127.0.0.1 at 2013-08-22 03:03:30 +0400
Served asset /jquery.stepy/js/jquery.stepy.min.js - 304 Not Modified (0ms)
Started GET "/assets/jquery.stepy/js/jquery.validate.min.js?body=1" for 127.0.0.1 at 2013-08-22 03:03:30 +0400
Served asset /jquery.stepy/js/jquery.validate.min.js - 304 Not Modified (0ms)
Started GET "/assets/jquery.stepy/test/lib/jasmine-html.js?body=1" for 127.0.0.1 at 2013-08-22 03:03:30 +0400
Served asset /jquery.stepy/test/lib/jasmine-html.js - 304 Not Modified (0ms)
Started GET "/assets/jquery.stepy/test/lib/jasmine-jquery.js?body=1" for 127.0.0.1 at 2013-08-22 03:03:30 +0400
Served asset /jquery.stepy/test/lib/jasmine-jquery.js - 304 Not Modified (0ms)
Started GET "/assets/jquery.stepy/test/lib/jasmine.js?body=1" for 127.0.0.1 at 2013-08-22 03:03:31 +0400
Served asset /jquery.stepy/test/lib/jasmine.js - 304 Not Modified (0ms)
Started GET "/assets/jquery.stepy/test/spec.js?body=1" for 127.0.0.1 at 2013-08-22 03:03:31 +0400
Served asset /jquery.stepy/test/spec.js - 304 Not Modified (0ms)
Rendered /usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.7ms)
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-08-22 03:03:31 +0400
Served asset /jquery.js - 304 Not Modified (0ms)`
Then the user goes to new_user_group_path, fills the form and clicks create. At this moment page refreshes and I see the same form(empty) and url with all params that the form was populated on the previos step. Like this users/user_id/groups/new?utf8=✓&authenticity_token=...
This jumps out at me - the form should be submitting as a POST, but this is a GET. Can you post the generated HTML from the /users/:user_id/groups/new page and what shows up in log/development.log when you submit the form?
Related
I am trying to access the flip-kart seller API as i registered with Flipkart seller APIs - Developer Admin portal by following steps as given in the documentation:-
https://seller.flipkart.com/api-docs/FMSAPI.html
After successfully registered with Flipkart as i hit the first API that is used for generate the access token, but as i hit this API via my code it will return me the login page html as response. I also tried to hit this via postman by following steps:-
1)Type of request i tried with both (GET,POST)
2)Set appid and app-secret in the header
3)Use the following url:-
https://api.flipkart.net/oauth-service/oauth/token\?grant_type\=client_credentials\&scope=Seller_Api
The following response i get:-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Flipkart</title>
<link type="text/css" rel="stylesheet"
href="./style.css" />
<link type="text/css" rel="stylesheet"
href="./bootstrap.css" />
</head>
<body>
<div class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">Flipkart Permission Registration</a>
</div>
</div>
</div>
<div class="container">
<form id="loginForm" name="loginForm" role="form" class="form-signin" action="login.do" method="post">
<h2 class="form-signin-heading">Please sign in </h2>
<input type="email" class="form-control" placeholder="Email address"
name='j_username' required="" autofocus="">
<input type="password" name='j_password' class="form-control"
placeholder="Password" required="">
<button class="btn btn-lg btn-primary btn-block" type="submit" name="login">Sign in</button>
<input type="hidden" name="CSRFToken" value="987f582b-9a4e-4c6c-a14b-681f2b57ca34"></input>
</form>
</div>
</body>
</html>
i also tried with the sandbox URL they provided but same response on both cases.
As i google this issue i found somewhere that you need to change the URL like:-
https://api.flipkart.net/oauth-service/oauth/token?grant_type=client_credentials&scope=Seller_Api
i also tried with this but this will return the response as:-
{
"error": "unauthorized",
"error_description": "An Authentication object was not found in the SecurityContext"
}
So finally i am unable to get access-token for flipkart seller API. Please help me
Any help would be appreciated
Thanks!
You can get authCode using the following url in a browser by replacing appId with your flipkart appId: https://api.flipkart.net/oauth-service/oauth/authorize?client_id=appId&grant_type=authorization_code&response_type=code&scope=Seller_Api&state=1234
Once you get the authCode, using curl command you can get the access token by providing appId, appSecretKey and authCode: curl -u appId:appSecretKey https://api.flipkart.net/oauth-service/oauth/token\?grant_type=authorization_code\&state=1234\&code=authCode
I'm learning Spring and webflow and I'm having trouble with something which seems like it should be simple. My flow is capturing a query string parameter and stashing it in a flow-scoped variable when the flow begins. I'm trying to echo it on the first view-state. Errors ensue.
Here's the flow definition:
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
<on-start>
<set name="flowScope.foo" value="requestParameters.fubar" />
</on-start>
<view-state id="step1" view="../jsp/step1.jsp">
<transition on="next" to="step2" />
</view-state>
<view-state id="step2" view="../jsp/step2.jsp">
<transition on="next" to="step3" />
<transition on="prev" to="step1" />
</view-state>
<view-state id="step3" view="../jsp/step3.jsp">
<transition on="prev" to="step2" />
<transition on="next" to="done" />
</view-state>
<end-state id="done" view="endView" />
<end-state id="cancelled" view="../jsp/cancelledView.jsp" />
<global-transitions>
<transition on="cancel" to="cancelled" />
</global-transitions>
</flow>
step1.jsp:
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%# taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%# taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%# taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%# taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Step 1</title>
</head>
<body>
This is step 1
<h1>flowRequestContext.flowScope: ${flowRequestContext.flowScope}</h1>
<h1>flowRequestContext.flowScope["foo"]: ${flowRequestContext.flowScope["foo"]}</h1>
<h2>${flowScope}</h2>
<c:if test="${empty flowScope}">
<h1>FLOW SCOPE IS EMPTY!</h1>
</c:if>
<c:if test="${!empty flowScope}">
<h1>FLOW SCOPE IS *NOT* EMPTY!</h1>
</c:if>
<c:if test="${empty flowRequestContext.flowScope}">
<h1>flowRequestContext.FLOW SCOPE IS EMPTY!</h1>
</c:if>
<c:if test="${!empty flowRequestContext.flowScope}">
<h1>flowRequestContext.FLOW SCOPE IS *NOT* EMPTY!</h1>
</c:if>
<form:form id="myForm">
<input type="submit" id="next" name="_eventId_next" value="Next" />
<input type="submit" name="_eventId_cancel" value="Cancel" />
</form:form>
</body>
</html>
Resulting error:
javax.el.PropertyNotFoundException: Property 'foo' not found on type org.springframework.webflow.core.collection.LocalAttributeMap
javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:223)
javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:200)
javax.el.BeanELResolver.property(BeanELResolver.java:311)
javax.el.BeanELResolver.getValue(BeanELResolver.java:85)
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:67)
org.apache.el.parser.AstValue.getValue(AstValue.java:169)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
...
If I omit the attempt to access the key "foo" the page renders with the following output (where the query string is ?fubar=baz):
This is step 1
flowRequestContext.flowScope: map['foo' -> 'baz', 'viewScope' -> map[[empty]]]
FLOW SCOPE IS EMPTY!
flowRequestContext.FLOW SCOPE IS *NOT* EMPTY!
It looks like the identifier flowRequestContext.flowScope does refer to a map, and it looks like it does contain the key and value I would expect... but if I try to access it like a map in EL it doesn't cooperate.
just use ${foo} everything in your flowscope should be accessible with $
I am rendering partial on click using jquery. Here is the code for it
$('.actCell').click(function (){
alert('Load was performed.');
$.get('/policies/new', function(data) {
$('.policyAddForm').html(data);
});
});
Here is the controller code
def new
#policy = Policy.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: #policy }
end
end
This is my application.html
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Passport</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<%= stylesheet_link_tag "application", :media => "all" %>
</head>
<body>
<div class="header">
<div class="container">
<img src="/assets/ph_logo.png">
<div class="user"><%=current_user.email%> <div class="userDrop"></div></div>
<div class="userDropMenu">
<div class="userActRow">change password</div>
<div class="userActRow">sign out</div>
</div>
</div>
</div>
<div class="nav">
<div class="container">
<%= yield %>
</div>
</div>
<%= javascript_include_tag "application" %>
<%= yield :javascript %>
</body>
</html>
With above code the problem is my layout get messed up. Div I updated with partial form shows header so it is layout in a layout but my client_validation_gem properties work. as soon as I say layout false my layout issue get fixed but I lose the client_side_validation gem properties. I dont know what is the issue and I am really frustrated. Any help or direction will be very helpful. Thanks,
Looks like you're not loading the rails.validations and rails.validations.custom js files if you use layout: false. You may have to include them in the partial (something like this).
= javascript_include_tag 'rails.validations'
Edit
Just saw that you're adding the form dynamically. You'll also need to trigger client-side validations like this after adding the form:
$('form[data-validate]').validate();
Finally I figured out. I have to remove rails.validations.js file because it was outdated. And add '$('form[data-validate]').validate();' to js file as #David suggested. Thanks for help
express version is 3.2.5, ejs version is 0.8.4
I want to serve stylesheets/style.css
I am doing this way in app.js
app.use(express.static(path.join(__dirname, 'public')));
app.use(app.router);
// render article.ejs
app.get('/u/:name/:day/:title', function(req,res){
Post.getOne(req.params.name, req.params.day, req.params.title, function(err, post){
if(err){
req.flash('error',err);
return res.redirect('/');
}
res.render('article',{
title: req.params.title,
post: post,
user: req.session.user,
success: req.flash('success').toString(),
error: req.flash('error').toString()
});
});
});
my structure is header.ejs
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Blog</title>
<link rel="stylesheet" href="stylesheets/style.css">
</head>
<body>
article.ejs content is
<%- include header %>
<p class="info">
author:<%= post.name %> |
date:<%= post.time.minute %>
</p>
<p><%- post.post %></p>
<%- include comment %>
<%- include footer %>
When I access http://localhost:3000/
GET /stylesheets/style.css 304 9ms
while access localhost:3000/u/username/date/postname
GET /u/username/date/stylesheets/style.css 404 10ms
why it shows this /u/username/date/stylesheets/style.css directory
Any ideas?
You don't start your stylesheets path with a /. So it's loading "stylesheets/style.css" relative to whichever HTML file requested it.
Hello I am trying to run a ruby mongrel server on windows 7. I am using some video-js code to display a video.
<title>Waza Player</title>
<script src="video.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
VideoJS.setupAllWhenReady();
</script>
<link rel="stylesheet" href="video-js.css" type="text/css" media="screen" title="Video JS">
<body>
<div class="video-js-box">
<video id="example_video_1" class="video-js" width="720" height="304" controls="controls" preload="auto">
<source src="converted/randomvideo.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
</video>
</div>
</body>
when i use the same html and javascript in apache it works just fine.
I have setup the mimetype for mp4 video but that didn't seem to solve the issue.
any help would be appreciated
2011-04-09 06:45:55 -0700: Read error: #><Errno::ECONNABORTED: An established con
nection was aborted by the software in your host machine.>
d:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/h
ttp_response.rb:140:in `write'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/h
ttp_response.rb:140:in `write'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/handler/mongrel.rb:81:in
`block in process'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/file.rb:87:in `block in
each'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/file.rb:85:in `open'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/file.rb:85:in `each'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/handler/mongrel.rb:80:in
`process'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel.r
b:165:in `block in process_client'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel.r
b:164:in `each'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel.r
b:164:in `process_client'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel.r
b:291:in `block (2 levels) in run'
Do you mean this?
<video id="example_video_1" class="video-js" width="720" height="304" controls="controlspreload="auto">
<source src="randomvideo.mp4" type="video/mp4" />
</video>