search for: bhellman1

Displaying 20 results from an estimated 25 matches for "bhellman1".

2011 Mar 08
2
Rails - Acts as Nested - Impossible move, target node cannot be inside moved tree.
Hello, I''m using the Awesome Nested Set plugin: https://github.com/collectiveidea/awesome_nested_set And in my model I do the following: acts_as_nested_set after_save :ensure_max_nestedset_level private def ensure_max_nestedset_level if self.level > 2 self.move_to_child_of(parent.parent) end end I do this to keep the levels from getting
2010 Sep 21
25
Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
Hello, I''m working to install the acts_as_commentable plugin on my Rails 3 app. After adding "acts_as_commentable" to my book model, I then added a comment form on my book show view: <% form_for(@comment) do|f| %> <%= f.hidden_field :book_id %> <%= f.label :comment %><br /> <%= f.text_area :comment %> <%= f.submit "Post
2010 Sep 26
2
Rails 3 - Loading a Subnav with Ajax… Which controller owns a subnav?
Once my Rails 3 app is loaded, a user can click an item which needs to then load a dynamic subnav. My thinking is (since it needs to be dynamic) is onClick to make a jQuery AJAX call to the server and then to inject the HTML response into a DIV on the page... What I''d like your advice on is how/where the subnav logic should live in the rails app, as I don''t have a navigation
2010 Dec 01
10
How to Redirect from http://mysite.com to https://www.mysite.com on Herok
Hello I''m looking to learn how to redirect all non-www (mysite.com) to https://www.mysite.com I tried the following: class ApplicationController < ActionController::Base before_filter :check_uri def check_uri redirect_to request.protocol + "www." + request.host_with_port + request.request_uri if !/^www/.match(request.host) if Rails.env ==
2010 Sep 12
11
Rails Commenting, Plugins?
Hello, I''m looking to add comments to records in my app like Books. So a user can view a Book and then comment on it... As a newbie, is this something that I should build from scratch, or are there any popular Commenting Plug-ins, (Ajax implemented) that might be worth utilizing? Thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2010 Sep 26
1
Rails 3 basic Get JSON with jQuery and output on the page flow question
Rails newbie, thanks for help with this hopefully basic JSON type question.... I have a model Books in my app, which belong_to users. What''d I''d like to learn how to do, is use jQuery to get a JSON object of the books that the user owns (current_user). And then use jQuery to list the results out on a div (id=targetdiv). Where I''m not certain, is this something Rails 3
2010 Oct 25
0
Rails 3 -NoMethodError (undefined method `original_filename
Hello! I''m using Rails 3, Uploadify, to send images to S3. Right now all the images being uploaded to S3 have the MIME: application/octet-stream I''d like to fix that but I''m getting the following error: NoMethodError (undefined method `original_filename'' for #<ActiveSupport::HashWithIndifferentAccess:0x107c81998>): app/models/photo.rb:29:in
2010 Oct 30
0
Will_Paginate — Set the Starting record ? IE, Photo 3, of 8
Hello. I''m working very hard to build projects > photo_albums > Photos But am Stuck on being able to implement it. Desired User Flow... #1 - User clicks their project #2 - User sees a list of photo albums #3 - Users clicks a Photo Album #4 - User see a list of photos in the album #5 - User views the clicked photo BUT has will_paginate showing in the nav for all
2010 Nov 10
0
Devise - Configuring the Routes fine for Controller Inheritance
Hi! Here''s what I added to my config/routes.rb: devise_for :users, :controllers => {:invitations => "invitations", :sessions => "sessions"} This doesn''t work, if I try to sign in I get a template missing error. How do you configure this for controller inheritance for invitations and sessions? And make the routes in the controller like
2010 Nov 17
0
Rails 3.0.3 - Error on Install
XXXXX-MacBook-Pro:cline xxxxxxx$ sudo gem install rails ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) SocketError: getaddrinfo: nodename nor servname provided, or not known (http://rubygems.org/gems/railties-3.0.3.gem) Anyone else getting this? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to
2010 Dec 03
0
Rake Routes project_attachment_path
Hello, I''m trying to create a project_attachment_path In my routes I have: resources :projects do collection do get "attachments/:id/:style.:format" => "attachments#download", :as => :attachment end end **Problem is in RAKE ROUTES:** attachment_projects GET /projects/ attachments/:id/:style.:format
2010 Dec 05
0
Rails - Using Tempfile to write on Heroku?
Hello, I need to be able to write a temporary file for use during the request only. Locally I can use the following successfully: tempfile = File.open(a.original_filename,''w'') tempfile.write_nonblock(a.body) paperclip stuff........ tempfile.close That works great, but not on Heroku... How can I do the above with Heroku''s restrictions:
2010 Dec 11
0
Rails 3 - Delayed_Job (collectiveidea), trying to Delay Mailers - Error: NoMethodError (undefined method `delay' for UserMailer:Class):
Hello, I have the following in an observer: UserMailer.delay.msg_notification(record) In user_mailer.rb class UserMailer < ActionMailer::Base ... def msg_notification(record) mail( :to => "#{record.user.email}", :subject => "Notification" ) end .. end But this errors with: NoMethodError (undefined method `delay'' for
2011 Jan 25
0
Rails 3 - Helping with a Commenting Module
class CommentsController < ApplicationController def create @commentable= context_object() @comment = @commentable.comments.build(params[:comment].merge(:user_id => current_user.id)) if @comment.save respond_to do |format| format.js end else render :action => ''new'' end
2011 Feb 18
0
Acts as nested - Enforcing a Max Level
Hello, I''m currently using the gem ''nested_set'' for comment threading. What I want to do is prevent the comment level from going more than 2 levels deep. What I tired doing was something like this: class Comment < ActiveRecord::Base .... before_save :ensure_max_nestedset_level private # We don''t want comments to go
2010 Dec 12
1
PGError: ERROR: invalid byte sequence for encoding "UTF8": 0xa0
Hello, my app is reading emails with attachments and inserting the Email message into the database to be sent to delayed job for processing. When inserting an email with attachments into the database, I get the following error: PGError: ERROR: invalid byte sequence for encoding "UTF8": 0xa0 Has anyone seen this before? There doesn''t seem to be much rails related via
2010 Sep 03
1
Action Controller Error: undefined local variable or method `current_user'
Newbie learning Rails. I''m currently on Chp9 here: http://railstutorial.org/chapters/sign-in-sign-out#top At the end of the tutorial, rails is erroring (see below). being new to Rails and after having checked the tutorial... How do you resolve this kind of error. It''s saying current_user is not defined, and it is supposed to be defined with/Sites/sample_app/app/helpers/
2010 Nov 01
2
paperclip Image Versioning
Hello. I''m hoping to hear your recommendations on using paperclip for images with versioning. Anyone know of any elegant paper_clip image, versioning implementation solutions? Thank you -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2010 Dec 22
2
Rails - JSON object with an array?
Hello, I''m able to create and send a JSON object like so: @mylist << { :id => item.id, :name => name.id } render :json => { :result => ''success'', :mylist => @mylist } That works great. Problem I''m having now is that I need to include users which can be 1 or users per item. @mylist << {
2010 Nov 11
2
Rails 3 - Nested Forms, using Builder -- Check_box issue
Hello, I have the following: My Controller: def new . . @teammembers.each do |teammember| request = @request_thread.requests.build(:recipient_id => teammember.user_id, :full_name => ''Billy Bob T'') end My View: . . <%= f.fields_for :requests do |builder| %> <div class="field"> <%= builder.label