Search Results

Search found 11032 results on 442 pages for 'junior rails programmer'.

Page 14/442 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Apache rails beta site access solution

    - by par
    I'm building an ror site and have been asked by to put a temporary access restriction on it. All that's needed is a general access restriction and common access info which can be emailed to invited beta users. The site is deployed on an apache server (on a mac) using passenger. I'm wondering what solutions there are?

    Read the article

  • Assign multiple css classes to a table element in Rails

    - by Eric K
    I'm trying to style a table row using both cycle and a helper, like shown: <tr class= <%= cycle("list-line-odd #{row_class(item)}", "list-line-even #{row_class(item)}")%> > However, when I do this, the resulting HTML is: <tr class = "list-line-odd" lowest-price> with the return from the helper method not enclosed in the quotes, and therefore not recognized. Here's the helper I'm using: def row_class(item) if item.highest_price > 0 and item.lowest_price > 0 and item.highest_price != item.lowest_price if item.current_price >= item.highest_price "highest-price" elsif item.current_price <= item.lowest_price "lowest-price" end end end I must be missing something obvious, but I just can't figure out how to wrap both the result of cycle and the helper method return in the same set of quotes. Any help would be greatly appreciated!

    Read the article

  • Refactoring Rails 3 Routes

    - by Martin
    Hello, I have this in my routes: get '/boutique/new' => 'stores#new', :as => :new_store, :constraints => { :id => /[a-z0-9_-]/ } post '/boutique' => 'stores#create', :as => :create_store, :constraints => { :id => /[a-z0-9_-]/ } get '/:shortname' => 'stores#show', :as => :store, :constraints => { :id => /[a-z0-9_-]/ } get '/:shortname/edit' => 'stores#edit', :as => :edit_store, :constraints => { :id => /[a-z0-9_-]/ } put '/:shortname' => 'stores#update', :as => :update_store, :constraints => { :id => /[a-z0-9_-]/ } delete '/:shortname' => 'stores#delete', :as => :destroy_store, :constraints => { :id => /[a-z0-9_-]/ } Is there a cleaner way to do the same? It doesn't look any elegant and even less if I add some more controls/actions to it. Thank you.

    Read the article

  • root path for multiple controllers on rails routes

    - by Lee
    I have two resource controllers where I am using a slug to represent the ID. (friendly_id gem). I am able to have the show path for one resource on the route but not for two at the same time. ie. root :to => 'home#index' match '/:id' => "properties#show" match '/:id' => "contents#show" Basically I want urls like, # Content domain.com/about-us domain.com/terms # Property domain.com/unique-property-name domain.com/another-unique-property-name Whatever resource I put on top works. Is there a way to do this? Thanks in advace if you can help.

    Read the article

  • Problem with displaying usernames in my flash[:notice] - Agile Web Development With Rails - Chapter

    - by Lee
    I can't figure out what I'm doing wrong here. I can’t seem to get the #{@user.name} to work in my flash[:notice] Everything else works just fine I can add new users, but when I add a new user instead of saying “User John Doe was successfully created”, it says “User #{@user.name} was successfully created.” I'm at this point in the depot app: depot_p/app/controllers/users_controller.rb to work.

    Read the article

  • Rails ActiveRecord - How to set association save order

    - by Altonymous
    I have a weird relationship that needs to be maintained for legacy processes. I'm trying to figure out how to create the relationship given the new model association. New Relationship Setup Machine has_many MachineReadings has_many Disks has_many DiskReadings Old Relationship Setup Machine has_many MachineReadings has_many DiskReadings has_many Disks The problem is data will come in on the Machine model as nested attributes using the new relationship setup. I need to update the machine_reading_id in the DiskReading model so the old association can continue to be used. I tried doing this via an after_save hook that would traverse back up to the machine and then down to the readings to get the machine_reading.id so I could populate the DiskReading model. However, the associations aren't being saved in the order I would expect. They are saving the Disks & DiskReadings before saving the MachineReadings. So when I go after the machine_reading.id it hasn't been written and thus I am unable to get access to it. For example: #machine_disk_reading.rb after_save :build_old_relationship def build_old_relationship self.machine_reading_id = self.disk.machine.readings.find_by_date_time(self.date_time).id end

    Read the article

  • Rails - How to connect Helper to Controller Module

    - by red eye
    I have helper: module BreadcrumbsHelper def breadcrumbs_cache_wrap(key, options, &block) ... end end And i extract part of Controller to module: module ApplicationController::Breadcrumbs def default_breadcrumbs ... end class ApplicationController include ApplicationController::Breadcrumbs ... end Now i want to connect Helper to Controller. I can do it like this: class ApplicationController include ApplicationController::Breadcrumbs helper :breadcrumbs ... end It's working. But can i incapsulate connection to Breadcrumbs Module? module ApplicationController::Breadcrumbs helper :breadcrumbs ... end Unfortunately this code is not working "undefined method `helper'".

    Read the article

  • Rails group validation with just one error message

    - by Victor
    The following validation code in the model: validates :formatted_address, :zip, :city, :state, :country, :presence => true, :message => "is incomplete. Please enter full address." is displayed when either of the fields are empty. Let's say now :address and country are empty, 2 errors are displayed: Formatted Address is incomplete. Please enter full address. Country is incomplete. Please enter full address. How can I group the error message in the validation to just show one error message if either of the fields validated does not exist? Address is incomplete. Please enter full address. Thanks.

    Read the article

  • Rails 3 respond_with, route constraints and resources

    - by Intelekshual
    I'm building a versioned API, so I have the following nested controllers: ApiController < ApplicationController Api::V1Controller < ApiController Api::V1::EventsController < Api::V1Controller The API is accessed via a subdomain. I have the following routes: constraints(:subdomain => "api") do scope :module => 'api' do namespace :v1 do resources :events end end end This produces the type of URL I want (/v1/events). The problem I'm facing is when using responds_with in Api::V1::EventsController. Just doing something as simple as the below fails with the error too few arguments: def index @events = Event.all respond_with(@events) end I know respond_width is meant to be used with resources, but I'm not sure how the events resource should be accessed from the constrained, scoped, and namespaced route. I can output other things (such as current_user), just not an array of events. Help?

    Read the article

  • Creating an instance in rails association

    - by Sandeep Rao
    I have three models where a basiccase has a form. Basic case can create a new form. class User < ActiveRecord::Base has_many :basiccases end class Basiccase < ActiveRecord::Base belongs_to :user has_one :basiccases end class Form3C < ActiveRecord::Base belongs_to :basiccases end I want to create an instance of form 3c in the form3c controller. Can any one explain me how I can carry the basiccase_id to the form3c controller to set the foreign key attribute. I can set the value using @basiccase.build_form3_c but I'm not sure how I can get the basiccase_id from the basiccase.

    Read the article

  • Rails - How to secure foreign keys and still allow association selection

    - by Bryce
    For simplicity, assume that I have a simple has-many-through relationship class User < ActiveRecord::Base has_many :courses, :through => :registrations end class Registration < ActiveRecord::Base belongs_to :user belongs_to :course end class Course < ActiveRecord::Base has_many :users, :through => :registrations end I want to keep my app secure, so I use attr_accessible to whitelist my attributes. My question is twofold: How would I set up my whitelist attributes such that I could create a new Registration object through a form (passing in :user and :course, but not risk allowing those foreign keys to be maliciously updated later? How would I set up my validations such that both belongs_to associations are required BUT also allow for Registration objects to be created in nested forms?

    Read the article

  • In rails, what defines unit testing as opposed to other kinds of testing

    - by junky
    Initially I thought this was simple: unit testing for models with other testing such as integration for controller and browser testing for views. But more recently I've seen a lot of references to unit testing that doesn't seem to exactly follow this format. Is it possible to have a unit test of a controller? Does that mean that just one method is called? What's the distinction? What does unit testing really means in my rails world?

    Read the article

  • when to choose ruby on rails over java [closed]

    - by Dany Y
    I have been working with Java EE for 6 years, and I have mostly used it even for simple applications like data-entry to database). I heard Ruby on Rails is superior to Java in this domain. What are the actual advantages of Ruby. and should I switch ? P.S : I know this is a subjective question, and the most probable answer is "depends on what you'll use it for", but this is exactly what I want to know when to use what. Thank you

    Read the article

  • Yahoo media player not working with Ruby on rails

    - by luca590
    I have a yahoo media player embedded in my webpage. I am currently using Ruby on Rails to create/edit my web page. When i click the play button next to a track the YMP waits a while and then goes to the next track without playing the first one. I then get a warning on my second (last) track that its file could not be found. Does anyone has a better recommendation for an audio player or a way to fix this one?

    Read the article

  • Passenger/Rails not releasing memory

    - by michaeldelorenzo
    I have an Ubuntu server running three separate Rails (2.3.8) applications with Passenger, REE and Apache. Recently we started experiencing problems with ruby processes eating up memory and consuming entire cores on our server. Here's what we're getting... %CPU PID USER COMMAND 99.9 1717 nobody Rails: /var/www/api 99.6 5542 nobody Rails: /var/www/api 97.3 1223 nobody Rails: /var/www/api 4.7 5537 nobody Passenger ApplicationSpawner: /var/www/api 10.5 1801 nobody Rails: /var/www/api We've also seen instances where there have been over 100 instances of Apache running. These applications have been running for a few months without an of these issues, but in the last day or so we've been noticing this. The site referenced here is a Rails application that is a RESTful API so it serves many requests every minute. Any guidance on what we should be checking or looking out for would be appreciated.

    Read the article

  • How do I make the correct career decision in regards to product manager/QA vs programmer?

    - by Adel
    I'm curious about how to approach the issue of whether I should focus on programming or on QA/testing/product management. I know that the latter seems like a broad category( if so, think of it as "general IT support" for now). At the moment I'm stronger in QA/prod. mgt ; however I'd like to switch more to programming, and I see I may have this opportunity. Wouldn't it be easier to switch to QA/prod. mgt in the future, if I go into programming now; rather than trying the reverse-order(i.e. if I decided later to go into coding.. say around mid-30s then it'd likely be harder). Just looking for any advice or tips about how to see more clearly. Part of me is scared I can't handle the programming side, but part of me says since there's demand and I'm interested that it's still worth a shot.

    Read the article

  • How does a programmer without a degree gain experience? [on hold]

    - by user96872
    Having a few years of experience is a must for many programming jobs nowadays. If one does not have a college degree but would like to get some experience with programming (with some prior knowledge, say, in JavaScript, PHP and Python), what are some ways to gain the experience that employers seek? I know about personal projects, but how about team experience and everything that goes along with it? Would I need to volunteer somewhere?

    Read the article

  • Gitorious errors

    - by Switz
    I installed Gitorious on my (shared) hosting. I was getting errors, but I seemed to have fixed most of them. It is working. When I commit/push, I get a lot of remote: errors spewed out although it does push the files properly from what I can tell. Here are the errors I'm getting (I swapped out the domain to git.domain.com): $ git push origin master Counting objects: 5, done. Delta compression using up to 2 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 283 bytes, done. Total 3 (delta 2), reused 0 (delta 0) remote: /home/saegit/GIT.DOMAIN.COM/vendor/rails/activesupport/lib/active_support/inflector.rb:361:in `const_defined?': wrong constant name Admin/usersHelper (NameError) remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/activesupport/lib/active_support/inflector.rb:361:in `constantize' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/activesupport/lib/active_support/inflector.rb:360:in `each' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/activesupport/lib/active_support/inflector.rb:360:in `constantize' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb:162:in `constantize' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/actionpack/lib/action_controller/helpers.rb:137:in `helper' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/actionpack/lib/action_controller/helpers.rb:115:in `each' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/actionpack/lib/action_controller/helpers.rb:115:in `helper' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/actionpack/lib/action_controller/helpers.rb:120:in `helper' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/actionpack/lib/action_controller/helpers.rb:115:in `each' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/actionpack/lib/action_controller/helpers.rb:115:in `helper' remote: from /home/saegit/GIT.DOMAIN.COM/app/controllers/searches_controller.rb:22 remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/activesupport/lib/active_support/dependencies.rb:158:in `require' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/activesupport/lib/active_support/dependencies.rb:158:in `require' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/activesupport/lib/active_support/dependencies.rb:265:in `require_or_load' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/activesupport/lib/active_support/dependencies.rb:224:in `depend_on' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/activesupport/lib/active_support/dependencies.rb:136:in `require_dependency' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/railties/lib/initializer.rb:414:in `load_application_classes' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/railties/lib/initializer.rb:413:in `each' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/railties/lib/initializer.rb:413:in `load_application_classes' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/railties/lib/initializer.rb:411:in `each' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/railties/lib/initializer.rb:411:in `load_application_classes' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/railties/lib/initializer.rb:197:in `process' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/railties/lib/initializer.rb:113:in `send' remote: from /home/saegit/GIT.DOMAIN.COM/vendor/rails/railties/lib/initializer.rb:113:in `run' remote: from /home/saegit/GIT.DOMAIN.COM/config/environment.rb:24 remote: from /home/saegit/GIT.DOMAIN.COM/lib/gitorious/messaging/sync_adapter.rb:27:in `require' remote: from /home/saegit/GIT.DOMAIN.COM/lib/gitorious/messaging/sync_adapter.rb:27:in `load_env' remote: from /home/saegit/GIT.DOMAIN.COM/lib/gitorious/messaging/sync_adapter.rb:31:in `load_processor' remote: from /home/saegit/GIT.DOMAIN.COM/lib/gitorious/messaging/sync_adapter.rb:55:in `queue' remote: from /home/saegit/GIT.DOMAIN.COM/lib/gitorious/messaging/sync_adapter.rb:59:in `do_publish' remote: from /home/saegit/GIT.DOMAIN.COM/lib/gitorious/messaging.rb:39:in `publish' remote: from ./hooks/messaging.rb:45:in `post_message' remote: from hooks/post-receive:37 remote: => Syncing Gitorious... To [email protected]:os/ptd.git 7526ccb..3316eb2 master -> master

    Read the article

  • ruby on rails configuration

    - by Themasterhimself
    Im using the following guide for getting started with rails for ubuntu 9.10. http://guides.rails.info/getting_started.html I have installed both ruby and gem. gokul@gokul-laptop:~$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux] gokul@gokul-laptop:~$ gem -v 1.3.6 gokul@gokul-laptop:~$ For rails, gokul@gokul-laptop:~$sudo gem install rails doesnt seem to give any response. so used the synaptic package manager for installing it. And it seems to have installed correctly. gokul@gokul-laptop:~$ rails Usage: /usr/bin/rails /path/to/your/app [options] Options: -r, --ruby=path Path to the Ruby binary of your choice (otherwise scripts use env, dispatchers current path). Default: /usr/bin/ruby1.8 -d, --database=name Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite2/sqlite3/frontbase/ibm_db). Default: sqlite3 -D, --with-dispatchers Add CGI/FastCGI/mod_ruby dispatches code to generated application skeleton Default: false --freeze Freeze Rails in vendor/rails from the gems generating the skeleton Default: false -m, --template=path Use an application template that lives at path (can be a filesystem path or URL). Default: (none) Rails Info: -v, --version Show the Rails version number and quit. -h, --help Show this help message and quit. General Options: -p, --pretend Run but do not make any changes. -f, --force Overwrite files that already exist. -s, --skip Skip files that already exist. -q, --quiet Suppress normal output. -t, --backtrace Debugging: show backtrace on errors. -c, --svn Modify files with subversion. (Note: svn must be in path) -g, --git Modify files with git. (Note: git must be in path) Description: The 'rails' command creates a new Rails application with a default directory structure and configuration at the path you specify. Example: rails ~/Code/Ruby/weblog This generates a skeletal Rails installation in ~/Code/Ruby/weblog. See the README in the newly created application to get going. gokul@gokul-laptop:~$ app folder is created with all the proper folders. The problem starts with the following commands... gokul@gokul-laptop:~$ sudo gem install bundler [sudo] password for gokul: Successfully installed bundler-0.9.24 1 gem installed Installing ri documentation for bundler-0.9.24... Installing RDoc documentation for bundler-0.9.24... gokul@gokul-laptop:~$ bundle install Could not locate Gemfile gokul@gokul-laptop:~$ coming to the database, the default sqlite3 seems to have installed correctly. gokul@gokul-laptop:~$ sqlite3 SQLite version 3.6.16 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite The welcome aboard page is not being able to be found at (http://localhost:3000) after executing the following commands... gokul@gokul-laptop:~/Desktop$ rails blog create create app/controllers create app/helpers create app/models create app/views/layouts create config/environments create config/initializers create config/locales create db create doc create lib create lib/tasks create log create public/images create public/javascripts create public/stylesheets create script/performance create test/fixtures create test/functional create test/integration create test/performance create test/unit create vendor create vendor/plugins create tmp/sessions create tmp/sockets create tmp/cache create tmp/pids create Rakefile create README create app/controllers/application_controller.rb create app/helpers/application_helper.rb create config/database.yml create config/routes.rb create config/locales/en.yml create db/seeds.rb create config/initializers/backtrace_silencers.rb create config/initializers/inflections.rb create config/initializers/mime_types.rb create config/initializers/new_rails_defaults.rb create config/initializers/session_store.rb create config/environment.rb create config/boot.rb create config/environments/production.rb create config/environments/development.rb create config/environments/test.rb create script/about create script/console create script/dbconsole create script/destroy create script/generate create script/runner create script/server create script/plugin create script/performance/benchmarker create script/performance/profiler create test/test_helper.rb create test/performance/browsing_test.rb create public/404.html create public/422.html create public/500.html create public/index.html create public/favicon.ico create public/robots.txt create public/images/rails.png create public/javascripts/prototype.js create public/javascripts/effects.js create public/javascripts/dragdrop.js create public/javascripts/controls.js create public/javascripts/application.js create doc/README_FOR_APP create log/server.log create log/production.log create log/development.log create log/test.log gokul@gokul-laptop:~/Desktop$ cd blog gokul@gokul-laptop:~/Desktop/blog$ rake db:create (in /home/gokul/Desktop/blog) gokul@gokul-laptop:~/Desktop/blog$ rails server create create app/controllers create app/helpers create app/models create app/views/layouts create config/environments create config/initializers create config/locales create db create doc create lib create lib/tasks create log create public/images create public/javascripts create public/stylesheets create script/performance create test/fixtures create test/functional create test/integration create test/performance create test/unit create vendor create vendor/plugins create tmp/sessions create tmp/sockets create tmp/cache create tmp/pids create Rakefile create README create app/controllers/application_controller.rb create app/helpers/application_helper.rb create config/database.yml create config/routes.rb create config/locales/en.yml create db/seeds.rb create config/initializers/backtrace_silencers.rb create config/initializers/inflections.rb create config/initializers/mime_types.rb create config/initializers/new_rails_defaults.rb create config/initializers/session_store.rb create config/environment.rb create config/boot.rb create config/environments/production.rb create config/environments/development.rb create config/environments/test.rb create script/about create script/console create script/dbconsole create script/destroy create script/generate create script/runner create script/server create script/plugin create script/performance/benchmarker create script/performance/profiler create test/test_helper.rb create test/performance/browsing_test.rb create public/404.html create public/422.html create public/500.html create public/index.html create public/favicon.ico create public/robots.txt create public/images/rails.png create public/javascripts/prototype.js create public/javascripts/effects.js create public/javascripts/dragdrop.js create public/javascripts/controls.js create public/javascripts/application.js create doc/README_FOR_APP create log/server.log create log/production.log create log/development.log create log/test.log gokul@gokul-laptop:~/Desktop/blog$ hope some one can help me with this...

    Read the article

  • Rails solution for mobile-specific content filter?

    - by Damien Roche
    To note, I'm not interested in simply 'hiding' content for mobile devices, I want to filter out that content completely. I'm also not trying to address the issue by building a mobile specific interface (mob.example.com). There was another question regarding something similar: How do I prevent useless content load on the page in responsive design? The solution, in that post, was to set a session during the initial request, and then use the session to filter content on subsequent requests. I primarily develop in Rails, and I'm wondering if there are any gems or ruby-specific solutions to this problem?

    Read the article

  • How much to charge Ruby on Rails Website [closed]

    - by eWizardII
    I figured it be appropriate to ask this question on webmasters, over the stackoverflow site seeing as there are similar questions here. I am freelancing for a client in the Boston area, who has the html/css templates for their site made by another web designer. They are basically looking for someone to set up the template, and then make the backend so that a user can purchase music on their site (they are musicians). I am wondering then what would be an appropriate amount to charge them to develop such a system, I am a student, and this would be my 3rd Ruby on Rails project, but probably at least the 20 web design project I have been hired to do and I have other programming knowledge, Python, C, etc. I am thinking of suggesting that they pay 1000usd to set up such a system, but I don't know if this is appropriate. To me it seems justifiable given my experience, and the low end of RoR developers I have seen charging 25usd/hr all the way up to 150usd/hr. Any advice would be appreciated.

    Read the article

  • Rails Easy Data Dumping

    - by Madhan ayyasamy
    Hi Friends,The following useful snippets,you can find out the easiest way of ruby on rails environment data dumping. You’ll often need to get data from production to dev or dev to your local or your local to another developer’s local. One plug-in we use over and over is Yaml_db. This nifty little plug-in enables you to dump or load data by issuing a Rake command. The data is persisted in a yaml file located in db/data.yml. This is very portable and easy to read if you need to examine the data.01rake db:data:dump02 03example data found in db/data.yml04 05---06campaigns:07  columns:08  - id09  - client_id10  - name11  - created_at12  - updated_at13  - token14  records:15  - - "1"16    - "1"17    - First push18    - 2008-11-03 18:23:5319    - 2008-11-03 18:23:5320    - 3f2523f6a66521  - - "2"22    - "2"23    - First push24    - 2008-11-03 18:26:5725    - 2008-11-03 18:26:5726    - 9ee8bc427d94

    Read the article

  • 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

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >