ruby-on-rails-3

Ruby on Rails : FFMPEG fails after upgrade Mountain Lion to Mavericks

空扰寡人 提交于 2019-12-24 14:28:16
问题 yesterday I upgrade my OS fom Mountain Lion to Mavericks and all goes well until recently. We are developing a Ruby on Rails v3.2.13 application for manage videos (only MP4), which worked fine until yesterday with Mountain Lion. Today (with Mavericks) I try to upload a video but get the following error in the console: Running transcoding... ffmpeg -y -i /Users/ME/Documents/workspace/rails/rails3-devise/public/uploads/tmp/1382653048-574-3293/thumb_con02_apv_revisado_1280x720.mp4 -ss 0 -s

Rails 3.2.13, 500 error in development with no log

梦想与她 提交于 2019-12-24 14:06:17
问题 I've got problem with migrating rails 2.x -> 3.2.13 At some point, after fixing a few things, I get Completed 500 Internal Server Error in 76ms without any traceback. development.rb config.consider_all_requests_local = true config.action_controller.perform_caching = false Why there is no traceback and how to fix this? 回答1: you probably solved it but I wanted to share my couple of hours debugging about this issue as it can be very annoying. In short, I was having the same problem - 500

Sign in function not working

夙愿已清 提交于 2019-12-24 13:59:22
问题 I've built an app that allows users to sign up, sign in, and sign out (my own devise from the ground up, if you will). The app allows users to sign up, but when trying to sign in I get the following error: // (needless to say I'm at a stand still, who ever can figure this out is a genius in they're own right) NoMethodError in SessionsController#create undefined method `-' for nil:NilClass Rails.root: /Users/user/Sites/rails_projects/sample_app1 app/controllers/sessions_controller.rb:11:in

How can I implement fragment cache with dalli when using pagination (kaminari)?

无人久伴 提交于 2019-12-24 13:53:00
问题 I know dalli (caching) is pretty powerful plugin to enhance performance for static pages. But what about dynamic pages with pagination, which are updated quite often? What is the correct way to set up dalli ? One problem I've encountered for example: dalli recognizes different params[:page] as the same page when using pagination:( How would you guys design the system when using dalli for both the page that gets updated so often the page that won't be updated so often For example. I have 4

Heroku - ActiveRecord::StatementInvalid (PG::Error: ERROR: column “requested” does not exist

我们两清 提交于 2019-12-24 13:33:32
问题 I have an absense.html.erb which works fine in development and production. However when I try to access the page I get the following error: 2013-03-25T18:43:43+00:00 app[web.1]: Started GET "/absence" for 77.100.90.77 at 2013-03-25 18:43:43 +0000 2013-03-25T18:43:43+00:00 app[web.1]: 2013-03-25T18:43:43+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::Error: ERROR: column "requested" does not exist 2013-03-25T18:43:43+00:00 app[web.1]: LINE 1: ...LECT "holidays".* FROM "holidays" WHERE

Redirecting an old SSL domain to a new one on Heroku (w/ Rails 3)

家住魔仙堡 提交于 2019-12-24 13:25:51
问题 I've been googling for the past hour on this but can't quite get it nailed down. Perhaps you guys can assist here! Here's what I'm trying to do: Old site is: old.tld New site is: new.tld A bunch of folks access one particular legacy url on the old site via SSL, i.e.: https://www.old.tld/old_url I've just setup a brand new site on Heroku, running Rails 3, on the new domain. I also have installed Heroku's SSL Endpoint Add-on and am using a new secure subdomain: secure.new.tld I've got a bunch

can't generate delete link in rails mailing view

痴心易碎 提交于 2019-12-24 13:23:29
问题 In my view I have 2 links: one for edit, that works great, and one for destroy action. metod looks like: def create_ticket(ticket) @ticket = ticket @edit = edit_ticket_url(@ticket, :host => "localhost:3000", :guest_password => @ticket.guest_password) @destroy = ticket_url(@ticket, :host => "localhost:3000", :guest_password => @ticket.guest_password) mail(:to => @ticket.email, :subject => @ticket.subject) end in view template: <%= link_to "Edit Ticket", @edit %> <%= link_to "Delete Ticket",

In Rails, how do I limit which attributes can be updated, without preventing them from being created?

纵然是瞬间 提交于 2019-12-24 13:05:17
问题 I have a situation where an attribute can be created through a JSON API. But once it is created, I want to prevent it from ever being updated. This constraint causes my first solution, which is using attr_accessible , to be insufficient. Is there a nice way to handle this type of situation in rails, or do I have to perform a manual check in the update method? 回答1: You can use attr_readonly, this will allow the value to be set on creation, but ignored on update. Example: class User <

Append a partial with onclick event

旧巷老猫 提交于 2019-12-24 13:02:09
问题 I have my onclick event working but when it comes to displaying the partial it: only displays the text: <%= escape_javascript(render(:partial => payment)) %> I want it to fetch the parial and display it here is my code: $(".payment").append("<%= escape_javascript(render(:partial => payment)) %>"); tried with "" and '' around payment full jquery code for this $(document).ready -> $('.plans').change -> $(".payment").append("<%= escape_javascript(render(:partial => 'payment')) %>"); edit: this

Dynamic routes on runtime in Rails

喜夏-厌秋 提交于 2019-12-24 12:51:24
问题 I'm developing a site using refinery. Now for one specific page that is created in the back-end of refinery, i want to use my own controller and views. All the User can do with this page is to set the menu-position, title, meta-info etc. The URL for this page has to look the same as all the other pages. So for example, the menu structure looks like: menux menu1 menu2 specific page menux And the URL for "specific page" looks like "locale/menu1/menu2/specific page" The site is available in