Search Results

Search found 4 results on 1 pages for 'tshauck'.

Page 1/1 | 1 

  • Visual Database Design Application

    - by tshauck
    Hi, I'm getting to the point where the applications I write need a little more structure during the planning phase. So I'd like to use some sort of visual tool to design the tables and relationships. I'm on a mac and have tried mysql workbench, but I find it buggy and a bit bloated for my intended use. Is something that I could design in that has a nice interface and is primarily a tool for visual design? Thanks

    Read the article

  • Accessing Attributes in a Many-to-Many

    - by tshauck
    Hi, I have a rails app and I'd like to be able to do something like task.labels.first.label_name to get the label name of a task. However, I get an undefined method label_name. I did a t = Task.first; t.labels.first.label_name in the console, and that worked so I'm not sure what's going on. Here's the models then the locations of the error: class Categorization < ActiveRecord::Base belongs_to :label belongs_to :task end class Label < ActiveRecord::Base attr_accessible :label_name has_many :categorizations has_many :tasks, :through => :categorizations end class Task < ActiveRecord::Base attr_accessible :task has_many :categorizations has_many :labels, :through => :categorizations end The error is in the index <% for task in @tasks %> <tr> <td><%= task.task %></td> <td><%= task.labels.first.label_name %></td> <td><%= link_to "Show", task %></td> <td><%= link_to "Edit", edit_task_path(task) %></td> <td><%= link_to "Destroy", task, :confirm => 'Are you sure?', :method => :delete %></td> </tr> <% end %

    Read the article

  • Saving a Record with Rails Association

    - by tshauck
    Hi, I've been going through the Rails Guides, but have gotten stuck on associations after going through validations and migrations. So, I have the following models Job and Person, where a Person can have many jobs. I know that in reality there'd be a many-to-many, but I'm trying to get my handle on this first. class Job < ActiveRecord::Base belongs_to :people end and class Person < ActiveRecord::Base has_many :jobs end Here's the schema ActiveRecord::Schema.define(:version => 20110108185924) do create_table "jobs", :force => true do |t| t.string "occupation" t.boolean "like" t.datetime "created_at" t.datetime "updated_at" t.integer "person_id" end create_table "people", :force => true do |t| t.string "first_name" t.string "last_name" t.datetime "created_at" t.datetime "updated_at" end end Is there some I can do the following j = Job.first; j.Person? Then that'd give me access to the Person object associated with the j. I couldn't find it on guides.rubyonrails.org, although it has been very helpful getting a grip on migrations and validations thus far. Thanks PS, If there are any tutorials that covers more of this kind of things links would be great.

    Read the article

  • Redirect Using jQuery

    - by tshauck
    Hi, So I'm using jquerymobile for an app I'm creating. I have a link that if all the validation passes I'd like to go through, but if something fails I'd like to redirect. In the jquery something like this. Since it is jquerymobile the link will be a new div on the same index.html page - if that helps. $(#link).click(function(){ if(validation_fails) link_elsewhere; else return true; }

    Read the article

1