Search Results

Search found 13929 results on 558 pages for 'ruby on rails plugins'.

Page 45/558 | < Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >

  • Ruby on Rails background API polling

    - by Matthew Turney
    I need to integrate a free/busy calendar integration with Zimbra. Unlike outlook, it seems, Zimbra requires polling their API. I need to be able to grab the free/busy data in background tasks for 10's of thousands of users on a regular time interval, preferably every few minutes. What would be the best way to implement this in a Rails application without bogging down our current resque tasks? I have considered moving this process to something like node.js or something similar in Ruby. The biggest problem is that we have no control over the IO, as each clients Zimbra instances could be slow and we don't want to create a huge backup in tasks. Thoughts and ideas?

    Read the article

  • Zune API Library for Ruby

    - by kerry
    Those of you who know me, know my favorite music player is the Zune. For some reason it seems most of my spare time lately seems to be creating Zune API libraries for different languages (I have a PHP one as well).  Here’s another one for Ruby!  If you use it, let me know.  I would love to hear what people are working on. It’s hosted at github, and very easy to use. zune_card = Zune::ZuneCard.for('a_zune_tag') Checkout the README for deets on what fields the object will have.

    Read the article

  • Good ergonomic keyboards for ruby/rails programmer using vim (on Mac) [closed]

    - by Brand
    I'm looking to buy an ergonomic keyboard but I'm unable to find answers for my specific needs. I'm a programmer so I need to be able to have quick/easy access to my curly brace and bracket keys. I use vim extensively so having the ctrl and esc keys in a easier to reach location would help. I'm also a mac user (doing ruby/rails dev). With all these things in mind, what are some good options for ergonomic keyboards? I'm afraid someone will see this as "off topic" but please realize I need to ask fellow programmers. For example, I was thinking of the Kinesis Keyboard but read some reviews saying it's not good for programming. That's when I realized other programmers would be the best at answering this question.

    Read the article

  • What can procs and lambdas do that functions can't in ruby

    - by SecurityGate
    I've been working in Ruby for the last couple weeks, and I've come to the subject of procs, lambdas and blocks. After reading a fair share of examples from a variety of sources, I don't how they're much different from small, specialized functions. It's entirely possible that the examples I've read aren't showing the power behind procs and lambdas. def zero_function(x) x = x.to_s if x.length == 1 return x = "0" + x else return x end end zero_lambda = lambda {|x| x = x.to_s if x.length == 1 return x = "0" + x else return x end } zero_proc = Proc.new {|x| x = x.to_s if x.length == 1 puts x = "0" + x else puts x end } puts zero_function(4) puts zero_lambda.call(3) zero_proc.call(2) This function, proc, and lambda do the exact same thing, just slightly different. Is there any reason to choose one over another?

    Read the article

  • Migrating Ruby on Rails Website to New Server (Linux)

    - by GarytheWorm
    I have an existing website that is a Ruby on Rails project. I have another server i need to transfer the existing website too. The server i wish to transfer too was originally hosting the website so has the necessary gems/configuration are installed. I have tar the current releases shared dir from the old server and transfered them over to the new server. I have then unpack the tar in the apps directory to the new location which is a different URL path. My problem is now as you can see below that the path on the current - is pointing to the old url. ( i ran ls -la to see owenership) How can i change this current path to read with my new web address? current releases shared sitepack.tar root@server1:/var/www/clients/client1/NEWSITE.com/web/apps# ls -la current - /var/www/OLDSITE.com/web/apps/releases/20120130171636 root@server1:/var/www/clients/client1/NEWSITE.com/web/apps#

    Read the article

  • What to choose for beginner: PHP/Python/Ruby

    - by Nai
    I'm a beginner teaching myself to code but I would like he insight of the PSE community and helping choose where to start. My main objective is to be able to create a basic website to first test my business idea and from there iterate on it quickly to minimise my learning time. The most important criteria for me is speed. An example of speed would be pre-built components available open source and not having to write one from scratch. From my research, this seems to be a death match between the following languages and frameworks: PHP and CakePHP Python and Django Ruby and Rails Assumptions: I am going to be equally good (or bad) in all 3. It is going to be equally easy to find competent developers in either language. I know this to be false already by lets assume that it is. This question is not meant to karma whore as I've seen how passionate some of these standoff questions have been and I'll be happy to turn it into a community wiki.

    Read the article

  • Ruby: if statement using regexp and boolean operator [migrated]

    - by bev
    I'm learning Ruby and have failed to make a compound 'if' statement work. Here's my code (hopefully self explanatory) commentline = Regexp.new('^;;') blankline = Regexp.new('^(\s*)$') if (line !~ commentline || line !~ blankline) puts line end the variable 'line' is gotten from reading the following file: ;; alias filename backupDir Prog_i Prog_i.rb ./store Prog_ii Prog_ii.rb ./store This fails and I'm not sure why. Basically I want the comment lines and blank lines to be ignored during the processing of the lines in the file. Thanks for your help.

    Read the article

  • error when installing rmagic gem on Ubuntu 12.04 for Ruby on Rails

    - by PeaceDefender
    0 down vote favorite I am trying to get my Ruby on Rails application working and installing RMagic gem. But I get an error that says "Can't install RMagick 2.13.1. Can't find the ImageMagick library or one of the dependent libraries." Altough I have ImageMagick installed with its dependences. Terminal log : http://pastebin.com/vcgkbwZR I even tried to installed RMagic from Synaptic, but I get the same error when I run "bundle" command. Through my search, some people had problem with lib dependencies, but I believed I have them all installed. Another solution I found is this ( error installing RMagick from gem ) a little bit old and not sure if it is going to work for 12.04. BUT, I don't know where those configurations should go.

    Read the article

  • Ruby on Rails - How to migrate code from float to decimal?

    - by user1723110
    So I've got a ruby on rails code which use float a lot (lots of "to_f"). It uses a database with some numbers also stored as "float" type. I would like to migrate this code and the database to decimal only. Is it as simple as migrating the database columns to decimal (adding a decimal column, copying float column to decimal one, deleting float column, renaming decimal column to old float column name), and replacing "to_f" with "to_d" in the code? Or do I need to do more than that? Thanks a lot everyone Raphael

    Read the article

  • Formtastic nested model form fields (Rails 3)

    - by elsurudo
    So here's the scenario: User: has_one :company accepts_nested_attributes_for :company Controller: @user = User.new @user.build_company View: <% semantic_form_for @user, :url => register_path do |form| %> <h2>User Information</h2> <%= form.inputs %> <h2>Company Information</h2> <% form.semantic_fields_for :company do |company| %> <%= company.inputs %> <% end %> <%= form.buttons %> <% end %> After scouring the web, this SEEMS like it should work. However, all I get are the user inputs. The "semantic_fields_for :company" block outputs nothing at all... Am I missing something here, or is this perhaps a Rails 3 bug to do with Formtastic?

    Read the article

  • Rails ActionMailer problems on Mac

    - by seth
    I've been working on learning to use Rails the last couple days and I've run into something that I haven't been able to solve with Google. So I'm just creating a basic contact form that sends an email. Everything seems to be working ok in testing, which tells me that the form is working, and ActionMailer was implemented correctly, however, I'm having trouble configuring ActionMailer. I'm running OSX 10.6.2. I have postfix running and have verified that it's running using telnet localhost 25. When I try to use the form I get a "Connection refused" error. This is my current configuration: config.action_mailer.smtp_settings = { :address => 'localhost', :port => 25 } I thought I might need to set :domain but I'm kind of confused on what that should be set to in this situation.

    Read the article

  • MongoMapper, Rails, Increment Works in Console but not Controller

    - by Michael Waxman
    I'm using mongo_mapper 0.7.5 and rails 2.3.8, and I have an instance method that works in my console, but not in the controller of my actual app. I have no idea why this is. #controller if @friendship.save user1.add_friend(user2) ... #model ... key :friends_count, Integer, :default => 0 key :followers_count, Integer, :default => 0 def add_friend(user) ... self.increment(:friends_count => 1) user.increment(:followers_count => 1) true end And this works in the console, but in the controller it does not change the follower count, only the friends count. What gives? The only thing I can even think of is that the way that I'm passing the user in is the problem, but I'm not sure how to fix it.

    Read the article

  • Rails Foreign key setup question.

    - by James P. Wright
    I'm just (re)starting playing around with Rails and I'm making a little card game app. I cannot seem to figure out my Foreign Key setups. Say I have 4 objects: - Game - Player - Hand - Card A Game has many Players, which have many Hands which have many Cards. But the cards are also independent of a Hand, Player and Game. For example, I have 6 Cards in my database (1 to 6). It is possible that Card 3 could be in 2 Players Hands in the same Game. How can I set up my keys for this? Should I just create another object for "CardInHand" to simplify it?

    Read the article

  • Rails 2.3.x, named_scope chaining with INNER JOIN complication

    - by randombits
    I have two hypothetical classes, Foo and Bar. Foo contains many Bars. Bar can only belong to one Foo. Ultimately the SQL query I'm trying to make happen looks like the following: SELECT * from bar INNER JOIN foo ON bar.foo_id = foo.id where bar.in_use = 0 and bar.customer_id = 1 and foo.category = 0 That query does what I need. Now I'm trying to break the problem down in Rails using chained named_scopes. First, the straight forward in_use and customer_id scopes I have set: named_scope :available, :conditions => { :in_use => 0 } named_scope :not_available, :conditions => { :in_use => 1 } named_scope :customer, lambda { |num| { :conditions => { :customer_id => num } } } Now the part I'm stuck at, is I'm trying to do something like this in my code: abar = Bar.available.customer(1).category(0) how and where do I put the category named_scope to make this work?

    Read the article

  • Current date in rails form

    - by Dean
    Hi, Im learning rails and exploring a bit away from the book and creating a simple application with added functionality as i increase my knowledge. Im writing a simple blog application and i have a field in the form called date added, i don't want this to be a field i want it to get the date from the server and place it in to the database automatically. How would i go about doing this? I was thinking of a hidden field but then unsure on how to process the date and insert it to the hidden field. Is this the wrong way of going about things? Thanks in Advance, Dean

    Read the article

  • Wrap text around an image in rails and prawn

    - by stevenheidel
    I have a document with dynamic image and dynamic text and would like the text around the image. The image is right aligned on the landscape page. Here is what I have so far: pdf.bounding_box([0,pdf.bounds.top - 50], :width => pdf.bounds.width, :height => pdf.bounds.height-50) do pdf.text @article.title, :size => 30, :style => :bold pdf.text @article.content, :align => :left # image pdf.bounding_box([pdf.bounds.right - 250, pdf.bounds.top], :width => 250, :height => 250) do pdf.image image_path, :width => 250 end end The text goes right underneath the image. I tried doing this http://stackoverflow.com/questions/2085151/ruby-prawn-how-to-wrap-text-around-an-aligned-right-image but it didn't work. Help is appreciated, thanks.

    Read the article

  • How to perform bulk update using rails admin

    - by Shubham Kedia
    ![enter image description here][2] I just have to perform a Bulk update for my products using the action which i have defined. While inspecting the link, it displays the following: onclick="jQuery('#bulk_action').val('bulk_add_to_categories'); jQuery('#bulk_form').submit(); return false;" But when I click on it I get this error. I need to do something like this I need to have an separate UI for all the products that have came from that bulk action, and then put them into the selected categories, but I am not able to do that. Can anyone help me on this? Any help would be great. I have seen lot of tutorial and read the rails admin github page but I was not able to find anything helpful. Please guide me.

    Read the article

  • Rails session cookie not getting set

    - by bwizzy
    I have a rails app that is a CMS that uses dynamic subdomains for each site. For some reason when I deployed to production the session cookie is not getting set. I'm thinking this is leading to the "Invalid Authenticity Token" errors that are being thrown everywhere. I have my production.rb setup so that I can share sessions across subdomains. What could be going wrong that the cookie isn't being set at all? #production.rb config.action_controller.session[:domain] = '.domain.com' #environment.rb config.action_controller.session = { :session_key => '_app_session', :secret => '.... nums and chars .....' }

    Read the article

  • Rails Authentication

    - by Oluf Nielsen
    Hey, i need some help with rails, again! Last it was about Authlogic.. Well I'm gone a bit backward since.. I mean, Authlogic isn't a Authentcate system i like.. So now i wan't you guys to tell me what you think is the best! I going to use it to a project of mine. Where there has to be a few roles like Admin, User and Guest.. So might you guys can tell me what is good and what is bad..?

    Read the article

  • How to create a url for notification in Rails

    - by Salil
    Hi All, i want to send an email to user after he sign-up with code.for ex http://192.168.1.51:3000/logins/activate/435546dgfd757676657 #link contains in an email how can i create the above URL in my notifier model. i know following way url_for :controller=>'logins', :action=>'activate', :id=>'435546dgfd757676657' , :host=>'http://192.168.1.54:3000' Which is working properly. what i want that host should not be hard coded. How can i get host with port in a model. In controller i can find it using follwing ways request.host_with_port Please provide me correct ruby way for doing same.

    Read the article

  • Limit a user to view only associated records in rails

    - by trobrock
    I have an application with three Models (Profile - SubModel - SubSubModel) chained together with has many relationships. I am trying to limit a user, after logging in, to only retrieving records that are associated with their Profile. I am very new to rails and this is what I had been trying in the Profile model has_many :submodels, :conditions => {:profile_id => self.id} but this is returning an empty data set when calling with Profile.find_by_id(1).submodels, how else could I achieve what I am trying to do. Or should I handle this in the controller or view instead, I thought it sounded well suited for the model to handle this.

    Read the article

  • Help with a Join in Rails 3

    - by Adam Albrecht
    I have the following models: class Event < ActiveRecord::Base has_many :action_items end class ActionItem < ActiveRecord::Base belongs_to :event belongs_to :action_item_type end class ActionItemType < ActiveRecord::Base has_many :action_items end And what I want to do is, for a given event, find all the action items that have an action item type with a name of "foo" (for example). So I think the SQL would go something like this: SELECT * FROM action_items a INNER JOIN action_item_types t ON a.action_item_type_id = t.id WHERE a.event_id = 1 AND t.name = "foo" Can anybody help me translate this into a nice active record query? (Rails 3 - Arel) Thanks!

    Read the article

  • Rails Beta3 & PaperClip & Passenger Bundler::PathError

    - by firecall
    So I'm going around in circles with this - I'm using a fork of the Paperclip Rails gem to get it to work with Rails3. Works fine on my OSX box with Passenger. But on my server (CentOS 5) I get this this error: git://github.com/lmumar/paperclip.git (at rails3) is not checked out. Please runbundle install(Bundler::PathError)Blockquote I tried Bundle Pack, but that doesnt pack gems from github. I read a post about setting the parh to the BUNDLE_HOME in my application.rb file which I tried: ENV['BUNDLER_HOME']="~/.bundle/ruby/1.8/bundler/gems/" But that doesnt work. Any ideas anyone? I dont know what else to do and have no idea how to debug or trace the problem further :( Passenger version 2.2.11. thanks.

    Read the article

  • Complex queries using Rails query language

    - by Daniel Johnson
    I have a query used for statistical purposes. It breaks down the number of users that have logged-in a given number of times. User has_many installations and installation has a login_count. select total_login as 'logins', count(*) as `users` from (select u.user_id, sum(login_count) as total_login from user u inner join installation i on u.user_id = i.user_id group by u.user_id) g group by total_login; +--------+-------+ | logins | users | +--------+-------+ | 2 | 3 | | 6 | 7 | | 10 | 2 | | 19 | 1 | +--------+-------+ Is there some elegant ActiveRecord style find to obtain this same information? Ideally as a hash collection of logins and users: { 2=>3, 6=>7, ... I know I can use sql directly but wanted to know how this could be solved in rails 3.

    Read the article

  • Saving gzipped string into Sqlite3 via Rails throws unrecognized token error

    - by user141146
    Hi, I'm using rails 2.3 and I'm trying to compress (gzip) text that I'd like to save using ActiveRecord into a sqlite database. However, the compressed text isn't being saved b/c I get this type of error: SQLite3::SQLException: unrecognized token: "'x##U?#7 Any thoughts on what I can do to avoid this error? should I compress the text in some other fashion? should I save the data using some other method(s)? Relevant code is below. # compress my text require 'zlib' defl = Zlib::Deflate test_string = "<h3>some text</h3>some additional text<p>here's some more text</p>" compressed_string = defl.deflate(test_string) => "x\234\263\3110\266+\316\317MU(I\255(\261\321\207\361\022SR2K2\363\363\022s \022\005v\031\251E\251\352\305\n`\331\334\374\"\230\206\002;\000\0225\027\222" ModelClass.new(:attribute1 => compressed_string).save ActiveRecord::StatementInvalid: SQLite3::SQLException: unrecognized token: "'x#####+##MU(I#(#?####2K2#### v#E####

    Read the article

< Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >