similar to: Create a select with HABM

Displaying 20 results from an estimated 10000 matches similar to: "Create a select with HABM"

2012 Feb 07
10
Encoding error
Hello, I have in my db a register what have special characters, and when I try to put on my form to edit this values, this happens: incompatible character encodings: UTF-8 and ASCII-8BIT Extracted source (around line #4): 1: <%= form_for :group, :url => { :action => "update" } do |f| %> 2: <%= utf8_enforcer_tag %> 3: <label>Nome do grupo</label>
2012 Jan 21
16
Installing rails on Ubuntu
Hello, I''m trying to install the rails on ubuntu 11.10, but when I put the command felipe@Felipe:~/Downloads/rubygems-1.8.15$ sudo gem install rails --no-r1 --no-rdoc ERROR: Loading command: install (LoadError) no such file to load -- zlib ERROR: While executing gem ... (NameError) uninitialized constant Gem::Commands::InstallCommand felipe@Felipe:~/Downloads/rubygems-1.8.15$
2012 Jun 30
5
Problems with associations
Hello guys, I have two tables, tasks and projects, and each model I put: Task.rb class Task < ActiveRecord::Base attr_accessible :user_id, :project_id, :name belongs_to :project end Project.rb class Project < ActiveRecord::Base attr_accessible :name, :description has_many :tasks end But when I go to my prompt and I make a SELECT with task, none project is returned.
2012 Mar 01
1
MD5 in action
Hello guys, I need to make a hash in each register, but I don''t know how I can do this. Just like this: <%= link_to :action => "index", :hash => MD5 :project.id %> /index?hash=202cb962ac59075b964b07152d234b70 Thank all! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2012 Feb 14
4
What I'm doing wrong, has_and_belong_to_many
Hello, I''m trying to insert into my migrate but when I try on rails console this error shows: 1.9.3-p0 :001 > group = Group.new => #<Group id: nil, name: nil, description: nil, created_at: nil, updated_at: nil> 1.9.3-p0 :002 > group.name = "Group Name" => "Group Name" 1.9.3-p0 :003 > group.description = "Description" =>
2012 Feb 17
5
undefined method `key?' for nil:NilClass PaperClip
Hello, I have a problem with the paperclip, I put on my GemFile gem "paperclip", "~> 2.6.0" I create a migrate class FileUpload < ActiveRecord::Migration def up change_table :projects do |t| t.has_attached_file :image end end def down drop_attached_file :projects, :image end end on my model I put class Project < ActiveRecord::Base
2012 May 31
14
How install libv8 (therubyracer) Windows 7
Hello, I have a problem when I try to add the gem therubyracer. I put in my prompt: bundle install, and this error appears: C:\rails\organily>bundle install Fetching gem metadata from https://rubygems.org/......... Using rake (0.9.2.2) Using i18n (0.6.0) Using multi_json (1.3.6) Using activesupport (3.2.3) Using builder (3.0.0) Using activemodel (3.2.3) Using erubis (2.7.0) Using journey
2012 Jul 17
24
Static Pages from Railcast
Hi everyone, I need several pages to be static but also modify when requested. I try following the railcast from Ryan at http://railscasts.com/episodes/117-semi-static-pages?view=comments Here what I have done!! rails g scaffold Pages name:string permanentlink:string title:string author:string access_level:string is_published:boolean meta_description:string meta_keyword:string
2012 Jul 19
6
Rendering Partial
I am a bit confused when coming from layout and partials. To start of I have a file called application.html.erb which has my layout such has follow <html> <head> <body> <%= render ''layouts/footer'' %> </body </html> This call a new file _footer.html.erb This file his has follow <footer class="footer"> <nav> <%=
2010 Dec 11
3
Why doesn't Heroku show the Rails default page?
Following chapter (1) of the Ruby on Rails tutorial: http://railstutorial.org/, I was able to successfuly push the application to "Heroku" using: > git push heroku master But, when I open the website, I get a page with the following: App crashed This application is temporarily offline. If you''re the administrator of this app, please check your heroku logs for the backtrace.
2013 Apr 24
3
join table naming
Hi, I’m an amateur learning rails and could use some help… I created a join table “pictures_questions” and append to it in the following way: @picture = Picture.new(params[:picture]) … if @picture.save @question.pictures << @picture Everything works fine but honestly I think I got this working by sheer luck and trial and error. I have 2 questions: 1. I do not understand the
2012 Jun 27
2
Select Helper Array of Array + Filter
Noob alert! Hi, I am having trouble figuring out how to filter a select helper. The following shows all of the rows in the table but I would like to filter the collection from the list_name column (:list_name => "Project Status"): @project_status = Valuelist.all.collect {|s| [s.list_value,s.id]} Thanks in advance, James -- Posted via http://www.ruby-forum.com/. -- You received
2012 Aug 17
5
How to Include Gem in Different Path
Hi, I just tried Ruby on Rails (with RailsInstaller 2.1.0) and it works fine on my PC. However, when I put this on the website, I got the following error message: Could not find multi_json-1.3.6 in any of the sources (Bundler::GemNotFound) The problem is that the website has multi_json 1.0.4. The website allows me to download my own gems, but after the process, it is located at
2013 Mar 02
3
Following railstutorial.org tutorial, how to make the microposts be seen by all?
I am a new learner of Ruby on Rails. I followed through the railstutorial.org tutorial and I''m trying to learn off the sample demo app where you can to make microposts and only the people who are "following" you can see them. If I wanted to make it so every user can see microposts as an additional functionality, what are the steps to do that? -- Posted via
2011 Oct 18
15
Generate model from database
hello i want to ask, how to generate model from table in my database. That''s possibel ? -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send
2012 Jun 27
5
explanation required on def method = (.)
hello, i''ve come across a code like def password=(pass) @password = pass . . end Anyone can please explain to me what is happening in the first line itself for the def part? the code I saw did not provide anything on it -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To
2012 Nov 30
4
Tokeninput incremental search not working
Rails 3.1.3 After watching http://railscasts.com/episodes/258-token-fields?autoplay=true I have installed the similar functionality to my app. However, def index @cities = City.all ... does in fact give the list of all cities in the text field, but def index @cities = City.where("name like ?", "%#{params[:q]}%") ... does NOT
2012 Apr 10
6
User Association
Please Im trying to create an application where i can post like twitter, but i was the users name to be posted under their respective posts My Post_controller looks like this def index @posts = Post.all(:order => "created_at DESC") @users = User.find(:all) #@user_id = current_user.find(params[:id]) respond_to do |format| format.html end end def create
2012 Jun 30
4
find_by_sql and join
hi I amd tanizawa. I had problem. I can not get main.name value from below sql. "find_by_sql ''select main.id,main.name,sub.name from main left join sub on sub.id = main.id''" Please teach me how to get borth name value. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the
2013 Apr 03
2
strange behavior with active relation any? method
In console, I run the following and any? returns true: drivers = Driver.select("drivers.*, drivers.id").joins([:reports, :driving_habits]).where("extract(MONTH FROM reports.time) = ? AND extract(YEAR FROM reports.time) = ?", 3, 2013).uniq.order("drivers.id asc").page(2).per(1) drivers.any? => true This correctly evaluates to true because the relation contains one