«ruby-on-rails-3» 태그된 질문

Ruby on Rails는 Ruby로 작성된 오픈 소스 웹 개발 프레임 워크입니다. Ruby on Rails는 구성에 대한 컨벤션 원칙을 따르므로 생산성을 유지하기 위해 물건을 다시 발명 할 필요가 없습니다. 이 태그는 Rails 3 관련 질문에만 사용하고 해당 질문에 [ruby-on-rails] 태그를 지정하십시오.


15
rails install pg- 'libpq-fe.h 헤더를 찾을 수 없습니다.
$ sudo bundle install 결과 Fetching gem metadata from https://rubygems.org/........... Fetching gem metadata from https://rubygems.org/.. Using rake (0.9.2.2) Using i18n (0.6.1) Using multi_json (1.3.6) Using activesupport (3.2.8) Using builder (3.0.4) Using activemodel (3.2.8) Using erubis (2.7.0) Using journey (1.0.4) Using rack (1.4.1) Using rack-cache (1.2) Using rack-test (0.6.2) Using hike …

3
Rails Admin vs. ActiveAdmin [닫기]
현재이 질문은 Q & A 형식에 적합하지 않습니다. 사실, 참고 문헌 또는 전문 지식이 답변을 뒷받침 할 것으로 기대하지만이 질문은 토론, 논쟁, 여론 조사 또는 확장 된 토론을 유도 할 가능성이 높습니다. 이 질문을 개선하고 다시 열 수 있다고 생각 되면 도움말 센터 를 방문하여 안내를 받으세요. 휴일 팔년 전에 …

2
Rails 번들 설치 프로덕션 전용
나는 여전히 rails / ruby ​​/ bundler를 처음 사용하고 약간 혼란 스럽습니다. 우리에 config/application.rb파일이 들러 세그먼트가있다 : if defined?(Bundler) # If you precompile assets before deploying to production, use this line Bundler.require(*Rails.groups(:assets => %w(development test))) # If you want your assets lazily compiled in production, use this line # Bundler.require(:default, …

5
80 포트에서 레일 s -p80을 실행하는 방법은 무엇입니까?
기본적으로, rails s #running on 3000 port 이제 포트 80에서 실행하고 싶습니다. 그래서 시도했습니다. sudo rails -s -p80 그러나 오류가 발생했습니다. mlzboy@mlzboy-MacBook ~/my/b2c2 $ sudo rails s -p80 sudo: rails: command not found rvm을 사용하여 루비 및 레일을 설치했습니다. rvm이 사용자 지정 인 것 같습니다. 루트에서 레일을 찾을 수 없습니까? …

5
Rake DSL 메소드에 대한 전역 액세스는 더 이상 사용되지 않습니다.
Ruby on Rails 3 자습서 책을 읽고 있으며 명령 줄에 다음을 입력했습니다. rake db:migrate 다음 경고를 생성했습니다. WARNING: Global access to Rake DSL methods is deprecated. Please Include ... Rake::DSL into classes and modules which use the Rake DSL methods. WARNING: DSL method DemoApp::Application#task called at /Users/imac/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks' 어떻게해야하는지, 어떻게 …

19
서버가 호스트 "localhost"(:: 1)에서 실행 중이고 포트 5432에서 TCP / IP 연결을 허용합니까?
먼저 Stack Overflow 및 웹 전체의 기사에서 몇 가지 유사한 질문을 찾았지만 그중 어느 것도 내 문제를 해결하는 데 도움이되지 않았습니다. PG 오류는 서버에 연결할 수 없습니다. 연결이 거부되었습니다. 서버가 포트 5432에서 실행 중입니까? PG :: ConnectionBad-서버에 연결할 수 없음 : 연결이 거부되었습니다. psql : 서버에 연결할 수 없음 : …

13
부울에 문자열 "true"및 "false"
Rails 애플리케이션이 있고 jQuery를 사용하여 백그라운드에서 내 검색보기를 쿼리하고 있습니다. 필드 q(검색어) start_date,, end_date및 internal. 이 internal필드는 확인란이며 is(:checked)쿼리되는 URL을 작성하는 방법을 사용하고 있습니다 . $.getScript(document.URL + "?q=" + $("#search_q").val() + "&start_date=" + $("#search_start_date").val() + "&end_date=" + $("#search_end_date").val() + "&internal=" + $("#search_internal").is(':checked')); 이제 내 문제는 params[:internal]"true"또는 "false"를 포함하는 문자열이 있고 …

5
게시하는 링크에 Rails link_to 사용
게시물 요청을 제출하는 데 필요한 링크가 있습니다. 일반적으로 jQuery를 사용하고 링크의 기본 동작을 방지 한 다음 대상에 양식을 제출합니다. 이것은 Rails가 나를 도울 수 있어야 할 것 같습니다. 물론이 link_to메소드에는 POST http 메소드를 지정하는 옵션이 있습니다. link_to "Profile", 'http://example.com/profile', method: :post 작동하지만 2 개의 매개 변수도 추가해야합니다. 나는 시도했다 : …

7
숫자가 범위 (하나의 문)에 포함되어 있는지 확인하는 방법은 무엇입니까?
Ruby on Rails 3.0.9를 사용하고 있으며 범위에 숫자가 포함되어 있는지 확인하고 싶습니다. 즉, 변수가있는 경우 값이 해당 범위에 포함되어 있으면 부울 값 number = 5을 확인 1 <= number <= 10하고 검색하고 싶습니다 number. 다음과 같이 할 수 있습니다. number >= 1 && number <= 10 하지만 저는 한 문장으로하고 …

7
Rails 3 : Ajax 호출에서 "redirect_to"하는 방법?
attempt_login로그인 양식을 제출 한 후 Ajax를 사용하여 다음 메소드를 호출합니다. class AccessController < ApplicationController [...] def attempt_login authorized_user = User.authenticate(params[:username], params[:password]) if authorized_user session[:user_id] = authorized_user.id session[:username] = authorized_user.username flash[:notice] = "Hello #{authorized_user.name}." redirect_to(:controller => 'jobs', :action => 'index') else [...] end end end 문제는 redirect_to작동하지 않는다는 것입니다. 이 문제를 …

7
해시 특정 키를 제외하고 모두 제거
주어진 키를 제외한 모든 키를 해시에서 제거하고 싶습니다. 예를 들면 : { "firstName": "John", "lastName": "Smith", "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021" }, "phoneNumber": [ { "type": "home", "number": "212 555-1234" }, { "type": "fax", "number": "646 555-4567" } ] } …

6
'rails generate controller'에 대한 테스트, 자산 및 도우미 생성을 건너 뛰는 구문?
도움말을 읽고 테스트, 자산 및 도우미 파일 생성을 건너 뛰기 위해 다음 명령을 시도했습니다. $ bin/rails generate controller home index --helper false --assets false --controller-specs false --view-specs false create- app/controllers/home_controller.rb route get "home/index" invoke erb create app/views/home create app/views/home/index.html.erb invoke rspec error false [not found] error false [not found] 이 …

14
Ruby on Rails 3 OSX에서 '/tmp/mysql.sock'소켓을 통해 로컬 MySQL 서버에 연결할 수 없습니다.
표준 Rails3 환경, RVM 1.2.9, Rails 3.0.5, Ruby 1.9.2p180, MySQL2 Gem 0.2.7, mysql-5.5.10-osx10.6-x86_64가 있습니다. rake db:migrate데이터베이스를 생성하기 위해 실행할 때 발생하는 오류 는 다음과 같습니다. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) config / database.yml에는 development: adapter: mysql2 host: localhost username: root password: xxxx database: xxxx 내가 …

5
요청 사양의 스터 빙 인증
요청 사양을 작성할 때 세션 및 / 또는 스텁 컨트롤러 메서드를 어떻게 설정합니까? 통합 테스트에서 인증 스텁을 시도하고 있습니다-rspec / requests 다음은 테스트의 예입니다. require File.dirname(__FILE__) + '/../spec_helper' require File.dirname(__FILE__) + '/authentication_helpers' describe "Messages" do include AuthenticationHelpers describe "GET admin/messages" do before(:each) do @current_user = Factory :super_admin login(@current_user) end it …

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.