ruby-on-rails-3.1

Ruby on Rails 3.1 and jQuery UI images

陌路散爱 提交于 2019-12-29 02:33:49
问题 I'm using Ruby on Rails (Edge, the development version), and Ruby rvm 1.9.2. application.js is as follows. //= require jquery //= require jquery-ui //= require jquery_ujs //= require_tree Where is the right place in Ruby on Rails 3.1 to put the jQuery UI theme? According to Autocomplete fields in Ruby on Rails 3.1 with jQuery UI I should put a jQuery UI theme in vendor/assets/stylesheets folder. That sounds like a smart place to have it, but I don't get it to work :-(. I managed to get the

bundle exec rake assets:precompile fails with `unexpected token`

倾然丶 夕夏残阳落幕 提交于 2019-12-28 17:38:52
问题 I'm ready to deploy my Rails 3.1 app into production, and since I'm using the asset pipeline, I need to precompile my assets. However, when I try this, I get an error apparently related to compiling jQuery: $ bundle exec rake --trace assets:precompile ** Invoke assets:precompile (first_time) ** Execute assets:precompile /home/adam/.rvm/rubies/ruby-1.9.3-p0/bin/ruby /home/adam/.rvm/gems/ruby-1.9.3-p0@rails-3.1/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace **

Can we call a Controller's method from a view (as we call from helper ideally)?

我的未来我决定 提交于 2019-12-28 02:39:26
问题 In Rails MVC, can you call a controller's method from a view (as a method could be called call from a helper)? If yes, how? 回答1: Here is the answer: class MyController < ApplicationController def my_method # Lots of stuff end helper_method :my_method end Then, in your view, you can reference it in ERB exactly how you expect with <% or <%= : <% my_method %> 回答2: You possibly want to declare your method as a "helper_method", or alternatively move it to a helper. What do helper and helper_method

Deploy Rails 3 site using AWS

安稳与你 提交于 2019-12-25 08:17:26
问题 I am going to be deploying a site i have built in rails 3 for the first time.. It has been recommended that I use AWS. I have read through some tutorials online but keep running into the same problem. When i run the command rails g vulcanize complete_passenger_mysql I get the following error message Could not find generator vulcanize. At first glance it seems as if rails 3.1 is not compatible with the Gem: rubber. has any one else had the same issue or knows of any way of doing this?. I am

Can anyone recommend a gem for searching that actually allows me to easily filter my results in ruby on rails?

偶尔善良 提交于 2019-12-25 06:46:49
问题 I've tried thinking sphinx after being pointed in that direction and simple filtering seems impossible. I've googled and asked questions for 2 days now and it seems it can't be done which is shocking because it's something commonly done when searching on websites. All I would like to do add filtering options to my search form such as filtering by one or a combination of: When user hits browse page all the sites users are returned but showing 20 results per page Filtering options in: location

How to allow access only to logged in users restricting direct entry of url?

£可爱£侵袭症+ 提交于 2019-12-25 06:46:07
问题 in a Rubyonrails application i want only logged in users to enterinto the inner pages? how can i redirect the direct entered urls to index page? in php if(!isset($_SESSION[id]) { header("location:index.php") }, how this can be implemented in ruby on rails 回答1: here goes In application_controller.rb: Putting this code in application_controller will make it available to all your controllers. class ApplicationController < ActionController::Base protect_from_forgery protected def confirm_logged

How can I render a view that is a part of my user controller on a static page like my home page?

本秂侑毒 提交于 2019-12-25 05:17:30
问题 I'm looking to place the signup form for an app I'm building on the app's home page, however I don't know how to render the view app/views/users/new.html.erb on my home page. Is there a method I can use to accomplish this? Thanks a bunch! 回答1: You can use a content_for block and then yield it on your application layout. Create a partial with your users/new page. (users/_new). In your homepage.html.erb file add <% content_for :homepage do %> <%= render users/new %> <% end %> Then in your

Trying to make a form in a jQuery dialog modal-form work. What am I missing?

馋奶兔 提交于 2019-12-25 05:17:05
问题 I want my views/blogs/new to open in a dialog. Tried to make it work per this SO answer: https://stackoverflow.com/a/5318155/732200 Here is my code (the blogs are called "fables"): This is my partial - views/fables/fablemaker.html.erb <div id="fableMaker" title="Fable Maker" style="display:none"> <div id="countdownTimer"> <span id="countdown_timer" class="timer">4:20</span><br /> <button id="play_btn">Play Timer</button> <button id="pause_btn">Pause Timer</button> <button id="reset_btn">Reset

Link_to rails nested form edit

随声附和 提交于 2019-12-25 04:55:21
问题 I just followed the following tutorial and works great. http://www.communityguides.eu/articles/6 However one thing his hard for me and that is an edit. I called my link_to edit has follow <%= link_to 'Edit', edit_article_comment_path(@article, comment) %> Which then bring me to a page with error and not sure why. NoMethodError in Comments#edit Showing /home/jean/rail/voyxe/app/views/comments/_form.html.erb where line #1 raised: undefined method `comment_path' for #<#<Class:0xa8f2410>

Rails Amazon production error [closed]

耗尽温柔 提交于 2019-12-25 04:24:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am running my ruby on rails app (rails 3.0.6 , ruby 1.9.3) on amazon server , on user sign up it shows the error - Something went wrong Updated log Started POST "/job_seeker/sign_up" for 122.169.118.210 at 2014-02-19 15:12:30 +0000 Processing by RegistrationsController#create as HTML Parameters: {"utf8"=>"✓",