RailsCasts Pro episodes are now free!

Learn more or hide this

MikeOnRails's Profile

GitHub User: MikeOnRails

Comments by

Avatar

and how much would that cost them to operate that many memcached servers

Avatar

I'm following along but getting some no hstore method erros when I run the migrations

rails g scaffold article name content:text published_on:date tags properties:hstore

and in the migration does this

execute "create extension hstore"
create_table :articles do |t|
t.string :name
t.text :content
t.date :published_on
t.string :tags, array: true
t.hstore :properties
t.timestamps
end

However, when I ran this migration I got an undefined method 'hstore' error. I then went into my test database and created the hstore extension as you see below (rather than in the migration file as Ryan did)

psql rails4test2_development
psql (9.2.3)
Type "help" for help.

rails4test2_development=# CREATE EXTENSION hstore;

But I got the same error when I ran the migration.

undefined method hstore' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition:0x007fa7ee7a9138>/Users/me/Sites/rails4test2/db/migrate/20130511204911_create_articles.rb:9:inblock in change'
/Users/me/Sites/rails4test2/db/migrate/20130511204911_create_articles.rb:4:in `change'

Can anyone help me understand why this isn't working for me?

Avatar

Rails gurus should probably have a pretty good idea how client side js frameworks work with Rails.

Avatar

Ryan, I hope you like Backbone best :), and use it instead of the others if you go deeper into these frameworks, which I also hope you do--rather than continuing to introduce new ones.

Having seen your coverage of Backbone, Angular, Ember etc, I'd feel pretty confident about learning batman.js on my own, for example, if I felt there was a need, and I assume it'd be similar for other subscribers. However, I'd really like to see you go deeper into how Backbone and Rails can be used together. Just my two cents.

Avatar

There's a ton of simple apps he could make. A blog, a forum, a store etc

Avatar

If you're going to keep previewing JavaScript frameworks can you please build a new app rather than do Raffler all over again. I get that it allows us to compare, but it also gets really samey-samey after a watching it being built 3,4,5 times.

Avatar

Agree or disagree.

Putting an edit form on an index page (as he does in the video) kind of makes Rails work like a javascript single page app. It seems to load and present the updates much faster, in addition to not having to redirect to a different page

Avatar

Why did he make it a "collection type route" in the first rewrite of the edits (at 1:52 of the video)?

ruby
resources :products do
  collection do
    put :discontinue
  end
end

i.e. did he have to do it that way? What would be alternative ways to do it? why is this way better? Thanks if you can help.

Avatar

fixed it by doing

brew uninstall node
brew install node

Avatar

when I try to start the forum-after application (with rails s), I'm getting thie following error. Does anyone know what's wrong, as in how to fix it? I did bundle install and it's not changing anything. Please note that I recently uninstalled MacPorts and the error might be associated with that, but i still don't know how to fix it.

ruby
Completed 500 Internal Server Error in 1479ms

ActionView::Template::Error (dyld: Library not loaded: /opt/local/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/bin/node
  Reason: image not found

  (in /Users/michaeljohnmitchell/Sites/authorizationPart1/forum-after/app/assets/javascripts/sessions.js.coffee)):
    3:   <head>
    4:     <title>Forum</title>
    5:     <%= stylesheet_link_tag    "application", media: "all" %>
    6:     <%= javascript_include_tag "application" %>
    7:     <%= csrf_meta_tag %>
    8:   </head>
    9:   <body>
  app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb___3636075050981736840_2167808160'


  Rendered /Users/michaeljohnmitchell/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.5ms)
  Rendered /Users/michaeljohnmitchell/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.2ms)
  Rendered /Users/michaeljohnmitchell/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (17.1ms)
^C[2012-10-08 23:48:50] INFO  going to shutdown ...
[2012-10-08 23:48:50] INFO  WEBrick::HTTPServer#start done.
Exiting
Avatar

according to my Pry console. Permission class has a class method called "members" which return :user. I don't see where this method is defined...Does anyone know?

Avatar

Why did it trigger an alert function when he clicked each entry (triggering "showEntry" and a new url opened?

Avatar

I've got require_tree . at the bottom (and everything else the same as your application.js file) however, I'm not able to get it to work. This is the error I'm getting in Firebug

Raffler.Routers.Entries is not a constructor
[Break On This Error]

new Raffler.Routers.Entries();

Avatar

"<%=j products_url %>";

products_url wasn't set as a variable anywhere. How did the above code get the url? localhost:3000/products

Why was the "j" necessary?

Avatar

I got the same error message if I try to authorize before I've signed into Devise. However, if I sign in through Devise and then try to authorize, it works, although that seems pretty pointless to require someone to authorize first through devise