我下面这篇文章中,我可以在下面和主页这个ruby文件这样写的代码确实有示例应用程序,但它仍然说静态页面的主页应该有内容"示例应用程序"当我运行 bundle exec rspec spec/requests/static_pages_spec.rb
spec/requests/static_pages_spec文件代码:
require 'spec_helper'
describe "Static pages" do
describe "Home page" do
it "should have the content 'Sample App'" do
visit '/static_pages/home'
page.should have_content('Sample App')
end
end
end
Run Code Online (Sandbox Code Playgroud)
home.html.erb
<h1>Sample App</h1>
<p>
This is the home page for the
<a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
sample application.
</p>
Run Code Online (Sandbox Code Playgroud)
下面是我的这个应用程序的宝石文件.请指教.谢谢你的帮助.
source 'https://rubygems.org'
gem 'rails', '3.2.1'
gem 'sqlite3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development do
gem 'rspec-rails', '2.6.0'
end
group :test do …Run Code Online (Sandbox Code Playgroud) 我有一个Php页面,其代码如下,我正在尝试应用此signup.css但它不起作用.在PHP管理员中,我可以看到CSS在Styles下显示为SignUp.css,我刚将这个css放在我的主题目录下作为SignUp.css,我尝试了"Signup.css",创建了一个css文件夹并放入这个css在那里尝试了"css/SignUp.css",但这也没有用.请帮忙 .谢谢你的时间
<html>
<link href="Styles/Signup.css" media="all" rel="stylesheet" type="text/css"/>
<head>
<title>Create</title>
</head>
<body>
<?php
if($_POST['action']=='create'){
//include database configuration
$dbhost = "localhost";
$dbuser = "abc";
$dbpass = "xyz";
$dbname = "test";
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
mysql_select_db($dbname) or die ('Unable to select database!');
//sql insert statement
$sql="insert into user ( firstname, lastname, username, Email, password )
values ('{$_POST['firstname']}','{$_POST['lastname']}','{$_POST['Email']}','{$_POST['username']}','{$_POST['password']}')";
//insert query to the database
if(mysql_query($sql)){
//if successful query
echo "New record was saved.";
}else{
//if query failed …Run Code Online (Sandbox Code Playgroud)