rails table html,Ruby on Rails HTML Table not displaying correctly

I am trying to create a simple Ruby on Rails index page using a table. My intention is to have the page include a HTML table that displays items from the model in each row. The model is called "Post", and it contains four attributes - Department, Professor, Course, and Title.

The problem is, the Table is displayed in a peculiar way as shown in the screenshot of the application at this link: http://i.stack.imgur.com/OkE6M.png.

There is a huge chunk of nonsense texts displaying right above the table. The table itself is being rendered as intended, but I do not understand why the unnecessary text chunk is being displayed. There is no error message when I run the application. The rest of the application is displayed properly and functional.

The source code of the view of the page looks like this:

index.html.erb

All posts

DepartmentProfessorCourseTitles

Upon inspecting the source of the rendered page, I found out that the block of the problematic text is included within the table group. Below is a partial excerpt from the rendered HTML:

* .....more code above *

Quod sed ex fuga nemo.Isabel Douglas IIISint qui natus nesciunt. Qui aperiam voluptas alias molestias nisi.Quod sed ex fuga nemo.Isabel Douglas IIISint qui natus nesciunt. Qui aperiam voluptas alias molestias nisi.

[#<Post id: 60, department: "Consequatur voluptatem.", professor: "Humberto Wisozk", course: "Suscipit rerum possimus culpa aut et.", content: "Beatae minima aut est eos.", user_id: 6, created_at: "2014-01-14 20:15:11", updated_at: "2014-01-14 20:15:11", title: "Sed quia.">, #<Post id: 59, department: "Consequatur voluptatem.", professor: "Humberto Wisozk", course: "Suscipit rerum possimus culpa aut et.", content: "Beatae minima aut est eos.", user_id: 5, created_at: "2014-01-14 20:15:11", updated_at: "2014-01-14 20:15:11", title: "Sed quia.">, #<Post id: 58, department: "Consequatur voluptatem.", professor: "Humberto Wisozk", course: "Suscipit rerum possimus culpa aut et.", content: "Beatae minima aut est eos.", user_id: 4, created_at: "2014-01-14 20:15:11", updated_at: "2014-01-14 20:15:11", title: "Sed quia.">, #<Post id: 57, department: "Consequatur voluptatem.", professor: "Humberto Wisozk", course: "Suscipit rerum possimus culpa aut et.", content: "Beatae minima aut est eos.", user_id: 3, created_at: "2014-01-14 20:15:11", updated_at: "2014-01-14 20:15:11", title: "Sed quia.">, #<Post id: 56, department: "Consequatur voluptatem.", professor: "Humberto Wisozk", course: "Suscipit rerum possimus culpa aut et.", content: "Beatae minima aut est eos.", user_id: 2, created_at: "2014-01-14 20:15:11", updated_at: "2014-01-14 20:15:11", title: "Sed quia.">, #<]

* more code below.... *

Below is the Gemfile used for the application:

source 'https://rubygems.org'

ruby '2.0.0'

#ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.0.1'

gem 'pg', '0.15.1'

gem 'bootstrap-sass', '2.3.2.0'

gem 'bcrypt-ruby', '3.1.2'

gem "simple_form"

gem 'faker', '1.1.2' # allow us to make sample users

gem 'will_paginate', '3.0.4' # pagination method

gem 'bootstrap-will_paginate', '0.0.9' # configures will_paginate to use Bootstrap's style

group :development, :test do

gem 'sqlite3', '1.3.8'

gem 'rspec-rails', '2.13.1'

end

group :test do

gem 'selenium-webdriver', '2.35.1'

gem 'capybara', '2.1.0'

gem 'factory_girl_rails', '4.2.1'

end

gem 'sass-rails', '4.0.1'

gem 'uglifier', '2.1.1'

gem 'coffee-rails', '4.0.1'

gem 'jquery-rails', '3.0.4'

gem 'turbolinks', '1.1.1'

gem 'jbuilder', '1.0.2'

gem 'jquery-datatables-rails', github: 'rweng/jquery-datatables-rails'

gem 'jquery-ui-rails'

group :doc do

gem 'sdoc', '0.3.20', require: false

end

group :production do

gem 'rails_12factor', '0.0.2'

end

Why is this happening?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值