我曾经能够从我的App文件夹中做到:
git add .
git commit -m "commit details"
git push
Run Code Online (Sandbox Code Playgroud)
我的本地机器上的最新版本的应用程序将在我的主仓库中备份,在github上.
现在,当我得到git add .命令时,我得到:
mycompaq@ubuntu:~/myapp$ git add .
error: insufficient permission for adding an object to repository database .git/objects
error: app/views/reviews/update.js.erb: failed to insert into database
error: unable to index file app/views/reviews/update.js.erb
fatal: updating files failed
mycompaq@ubuntu:~/myapp$
Run Code Online (Sandbox Code Playgroud)
我在Stackoverflow上的一条消息中读到了克服类似问题的方法:
chown -R user:user /project/directory
Run Code Online (Sandbox Code Playgroud)
但是看到我在运行命令时遇到了一大堆麻烦,我不确定,我想知道这是否是我的命令.它有什么作用?可以撤消吗?
如果用户是"Christophe",并且存储我的Rails应用程序的文件夹称为"myapp",那么确切的语法应该是什么?我的意思是它应该是
chown -R user:christophe /myapp/app/views/reviews/update.js.erb
Run Code Online (Sandbox Code Playgroud)
抱歉有这些问题.
我有一个ruby on rails项目,ruby2和rails4.我已经安装了bootstrap-sass gem.我最近安装了activeadmin gem,它将一个文件active_admin.css.scss添加到我的app/styles文件夹中:
// SASS variable overrides must be declared before loading up Active Admin's styles.
//
// To view the variables that Active Admin provides, take a look at
// `app/assets/stylesheets/active_admin/mixins/_variables.css.scss` in the
// Active Admin source.
//
// For example, to change the sidebar width:
// $sidebar-width: 242px;
// Active Admin's got SASS!
@import "active_admin/mixins";
@import "active_admin/base";
// Overriding any non-variable SASS must be done after the fact.
// For example, to change the default status-tag …Run Code Online (Sandbox Code Playgroud) 由于我精心修改了一些代码,我的网站工作得更快,但我很乐意,如果浏览器的后退/前进按钮有效.现在,使用下面的代码,浏览器地址栏永远不会改变.当有人点击"返回"时,会将其从应用程序中删除.
是否有任何简单的方法来改变这一点,以便浏览器的后退/前进按钮工作?否则,如果有人能指出我正确的方向.谢谢你的帮助.
$(document).on("ready", function () {
//I want to load content into the '.page-content' class, with ajax
var ajax_loaded = (function (response) {
$(".page-content")
.html($(response).filter(".page-content"));
$(".page-content .ajax").on("click", ajax_load);
});
//the function below is called by links that are described
//with the class 'ajax', or are in the div 'menu'
var history = [];
var ajax_load = (function (e) {
e.preventDefault();
history.push(this);
var url = $(this).attr("href");
var method = $(this).attr("data-method");
$.ajax({
url: url,
type: method,
success: ajax_loaded
});
});
//monitor for …Run Code Online (Sandbox Code Playgroud) 我试图改变输入框和标签之间的字体大小和间距,以我用simple_form gem 2.0.2生成的形式.我确定有办法做到这一点?
目前我有:
<%= f.input :comment, :input_html => { :wrap => :soft, :rows => 2}, :label => 'Type in box below:', :item_wrapper_class => 'type' %>
Run Code Online (Sandbox Code Playgroud)
在我的CSS中:
.type{
font-size: 24px;
margin-top: 15px;
}
Run Code Online (Sandbox Code Playgroud)
我在这个网站的帖子中读到'item_wrapper_class'可以解决这个问题,但是当我去Chrome中检查元素时,通过'下面的输入框:'部分,它甚至没有找到.type类,在我的CSS中 - 它只是在bootstrap中转到默认标签类.
任何帮助将不胜感激,谢谢.
我正在开发与Android Studio 2.2 RC 2.
在我的应用程序中,我收到错误消息:
Usage of API documented as @since 1.8+ less... (Ctrl+F1)
This inspection finds all usages of methods that have @since tag in their documentation.
This may be useful when development is performed under newer SDK version as the target platform for production.
Run Code Online (Sandbox Code Playgroud)
我做了一些研究来尝试解决该问题,我发现的第一个链接是:
Intellij - 无法使用较新的 Java 8 类 - 错误:“API 的使用记录为 @since 1.6+..”
它说要消除错误,您需要打开
File -> Project Structure -> Project Settings -> Modules -> "Your Module Name" -> Sources -> Language Level …Run Code Online (Sandbox Code Playgroud) 我已经为此工作了一段时间,但不明白我的代码有什么问题。我确信这很简单 - 总是如此!
\n\n基本上,我有一个下拉菜单,其中有一些选项。我希望它在选择第三个选项“管道工”时转到网页。单击其他任何一个时,不应发生任何事情。
\n\n到目前为止我的代码是:
\n\n<select id = \'search\'>\n<option value="1">Carpenter</option>\n<option value="2">Electrician</option>\n<option value="3">Plumber</option>\n<option value="4">Tiler</option>\n<option value="5">Boiler Installation</option>\n\n</select>\nRun Code Online (Sandbox Code Playgroud)\n\n去
\n\n我的 JavaScript 是:
\n\n<script>\nfunction go_button {\nif (search.value=="3") {\nlocation="search_results.htm"\n}\n}\n\n</script>\xe2\x80\x8b\xe2\x80\x8b\xe2\x80\x8b\xe2\x80\x8b\xe2\x80\x8b\xe2\x80\x8b\xe2\x80\x8b\nRun Code Online (Sandbox Code Playgroud)\n\n但它不起作用。有人能告诉我出了什么问题吗?
\n\n谢谢。
\n\nC。
\n目前,我的表单看起来像这样一个错误消息(名称是必填字段):

但是我想把"不能为空"的错误放在"名字"旁边,如下所示:

我通过使用以下代码更改默认引导程序Simple_form类,在"名称"标签上给自己更多自由和错误:
<%= f.input :name, :required => true, :label_html => { :class => 'edit_form_titles' }, :error_html => { :class => 'cant_be_blank'} %>
Run Code Online (Sandbox Code Playgroud)
我对这些课程的css是:
.edit_form_titles{
display: block;
margin-bottom: 0px;
color: #333333;
}
.cant_be_blank{
font-size:12px;
}
Run Code Online (Sandbox Code Playgroud)
关于我如何对齐名称旁边的错误消息的任何想法,正如我所描述的那样?谢谢你的帮助.
我收到消息:缺少包语句.这是红色的:

这是一个我到这里的简单项目,
我刚刚将MainActivity.java重命名为ContactWithAuto.java.我的项目构建正常,但当我尝试在手机上运行时,我得到:
Launching application: com.example.chris.autocompletetextview/ContactWithAuto.
DEVICE SHELL COMMAND: am start -n "com.example.chris.autocompletetextview/ContactWithAuto" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
open: Permission denied
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.chris.autocompletetextview/ContactWithAuto }
Error type 3
Error: Activity class {com.example.chris.autocompletetextview/ContactWithAuto} does not exist.
Run Code Online (Sandbox Code Playgroud)
我试过这个解决方案,但它不起作用: Android studio自动修复
还尝试了几次清理,构建,重启Android Studio.有任何想法吗?
这是我的代码:
ContactWithAuto.java:
import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AutoCompleteTextView;
import android.widget.SimpleAdapter;
import com.example.chris.autocompletetextview.R;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class ContactWithAuto extends Activity {
private …Run Code Online (Sandbox Code Playgroud) 我对Rails了解不多,我继承了这个项目.在过去的几天里,我一直在努力探索,"link_to"和"routes.rb".这个东西让我很生气 - 我花了一整天的时间来看待它,把一些代码粘贴到裸露的项目中,它的工作原理......但我只是不明白我到这里的错误,或者怎么去关于解决它,所以如果你有任何想法....
在我的页面_signed_in_header.html.erb我有:
<a href="../staticpages/faq">FAQ</a>
Run Code Online (Sandbox Code Playgroud)
在我的routes.rb我有:
get "staticpages/faq"
Run Code Online (Sandbox Code Playgroud)
我知道这是正确的,因为当我从头开始一个示例项目时,它的工作原理.
但在这个特定的项目中,我继承了我得到的错误:
NoMethodError in Staticpages#faq
Showing /home/christophecompaq/Populisto/app/views/layouts/_signed_in_header.html.erb where line #48 raised:
undefined method `model_name' for NilClass:Class
Extracted source (around line #48):
45:
46: <div class='search-box'>
47: <%= simple_form_for @review, :url => search_index_path, :method => :post, :html => { :class => 'form-horizontal'} do |f| %>
48:
49: <%= f.input :search_ids, :collection => @data, :as => :grouped_chosen,
50: :group_method => :last, :prompt => false,
51: :input_html => { :class => 'span5', :multiple => …Run Code Online (Sandbox Code Playgroud) 我正在使用设计.当用户"注册"时,他们会转到他们输入姓名,电子邮件,密码等的页面,然后单击"注册"按钮,如果输入的所有详细信息都正确,他们会进入应用程序,这就是应该发生.
我想要做的是添加一个链接,'通过点击"创建帐户",您确认您接受条款和条件.在注册页面上.就是这样,一个简单的链接 - 没有复选框或任何东西.
在"注册"页面代码我有:
<div class='t_and_c'>
By clicking "Create Account" you confirm that you accept
the <%= link_to "Terms and Conditions.", "static_pages#terms_and_conditions" %>
</div>
Run Code Online (Sandbox Code Playgroud)
但是每当有人点击链接时,它就会不断重新加载"注册"页面 - 这应该是它应该做的,因为某些代码告诉应用程序在用户登录之前不加载任何内容,所以我的问题是:
如果只是为了这个链接'条款和条件',我可以加载我的terms_and_conditions.html.erb,即使用户没有登录吗?我认为这是一些before_filter或skip_before过滤器,但我不知道如何去做.
android ×2
javascript ×2
simple-form ×2
activeadmin ×1
ajax ×1
chown ×1
css ×1
devise ×1
git ×1
github ×1
java ×1
jquery ×1
link-to ×1
ruby ×1
sass ×1