Obligatory "Me too". There was a note I saw about problems with the thin web server. Switched to plain old webrick to no avail. (Of course...) Works fine in dev. Only fails in production.
Nice! But I'm wondering, is there a reason not to do authorization from scratch? In all my apps now I've got user.admin field (or UserRole model when in one that need more privileges). Then I just use a before_filter to check whether user has given privileges, and skip_before_filter in controllers where certain authorization is not needed. Are there any disadvantages of that method?
Ryan, as you're a big fan of writing authentication from scratch, I'd really like to know your opinion on whether there is a good reason to not to do this for authentication.
Just getting things set up right. I know I had to add devkit before; and that there's some tweaking of environment variables; but no clear set of steps to follow. There is a pik devkit command, which throws an error.
Hmm. There is this, http://puneetpandey.com/tag/how-to-install-devkit-on-windows/
which reminded me to edit devkit\config.yml and add the new ruby location, e.g.
- C:/Ruby187
- C:\Users\Ed.pik\rubies\Ruby-192-p136
- C:\Users\Ed.pik\rubies\Ruby-193-p0
Maybe that's what pik devkit was supposed to do for me!
You must've been lucky with using delay as a Class method. I wonder what your stack is (ruby version/gem version/bundler version/rails version).
Gives a NoMethodError on Class when executing the job. The target class doesnt serialize/deserialize properly it seems. Seems like there are 3 open tickets relating to this on Github.
Lower priority numbers have higher priority. It is in documentation
By default all jobs are scheduled with priority = 0, which is top priority. You can change this by setting Delayed::Worker.default_priority to something else. Lower numbers have higher priority.
Could someone post an example of what the routes file for this project would look like? Im an extreme beginner, and so far can't figure out how I would configure it correctly.
With Rails 3.1.3 this does not seem to work. Mercury is escaping parameters. Here is a part of params hash:
Processing by PagesController#mercury_update as JSON
Parameters: {"content"=>"{\"page_name\":{\"type\":\"editable\",\"value\":\"about\",\"snippets\":{}},\"page_content\":{\"type\":\"editable\",\"value\":\"{\"page_name\":{\"type\":\"editable\",\"value\":\"about\",\"snippets\":{}},\"page_content
ad 1) yes, that's a Kaminari related issue. I guess it's trivial to define a paginate method, but nevertheless, there's a patch including the paginate methods for Kaminari based projects already.
ad 2) I don't understand the issue here, ie. what is "including" query do. Best to submit an issue at Github.
For the "grouped_collection_select", where is the ":states" parameter created? I use this one (both @sectors and @branches are filled in the controller):
Ok, tried different things, but in the end I made an app/validators in my engine, and since all in app is (auto?) loaded, the validators from the engine are now loaded too.
Also, the blog post mentioned by tuscanidream doesn't explain how to get lib in engine to autoload. I think it would be good to autoload stuff from eninges, that don't belong in app. Or, make something like app/validators, which makes more sense to me.
Obligatory "Me too". There was a note I saw about problems with the thin web server. Switched to plain old webrick to no avail. (Of course...) Works fine in dev. Only fails in production.
Any advantages of Mailman over Activemailer?
Nice! But I'm wondering, is there a reason not to do authorization from scratch? In all my apps now I've got user.admin field (or UserRole model when in one that need more privileges). Then I just use a before_filter to check whether user has given privileges, and skip_before_filter in controllers where certain authorization is not needed. Are there any disadvantages of that method?
Ryan, as you're a big fan of writing authentication from scratch, I'd really like to know your opinion on whether there is a good reason to not to do this for authentication.
Does ActiveAdmin supports sorting through a belongs_to column?
require 'capybara/rails'
capybara/rspec
was unable to load, this works fine for me.Using Rails 3.1 on Ubuntu.
+1
Also the Windows testing/autotesting setup has many dead-end rabbit holes.
Same problems for me
Just getting things set up right. I know I had to add devkit before; and that there's some tweaking of environment variables; but no clear set of steps to follow. There is a
pik devkit
command, which throws an error.Hmm. There is this,
http://puneetpandey.com/tag/how-to-install-devkit-on-windows/
which reminded me to edit devkit\config.yml and add the new ruby location, e.g.
- C:/Ruby187
- C:\Users\Ed.pik\rubies\Ruby-192-p136
- C:\Users\Ed.pik\rubies\Ruby-193-p0
Maybe that's what
pik devkit
was supposed to do for me!You must've been lucky with using delay as a Class method. I wonder what your stack is (ruby version/gem version/bundler version/rails version).
Gives a NoMethodError on Class when executing the job. The target class doesnt serialize/deserialize properly it seems. Seems like there are 3 open tickets relating to this on Github.
Are you sorted?
Thanks for this. Helped me out on Rails 3.1
Lower priority numbers have higher priority. It is in documentation
Anyway great tutorial ! Thanks
What is the difference between https://github.com/balupton/mercury-rails and https://github.com/jejacks0n/mercury ?
You're probably missing this line in your controller:
helper_method :sort_column, :sort_direction
This makes your 'sort_column' and 'sort_direction' controller methods available in your helper.
Any ideas on how to use multiple pop3 mailboxes for polling?
Could someone post an example of what the routes file for this project would look like? Im an extreme beginner, and so far can't figure out how I would configure it correctly.
-Thanks
premailer can generate plain-text emails.
Austin - look at this page
See "Integration with Rspec"...
Anyone running into CSV import issues, please modify the seed.rb file as follows:
require 'csv'
puts "Importing countries..."
CSV.foreach(Rails.root.join("countries.csv"), headers: true, encoding: "ISO8859-1") do |row|
Country.create! do |country|
country.id = row[0]
country.name = row[1]
end
end
puts "Importing states..."
CSV.foreach(Rails.root.join("states.csv"), headers: true, encoding: "ISO8859-1") do |row|
State.create! do |state|
state.name = row[0]
state.country_id = row[2]
end
end
Thanks Ryan, this is a really useful Gem.
FYI the ASCIIcast is missing a single quote in the "job_type :script" line of the first code block under the Creating Your Own Jobs section.
Use Procfiles with foreman gem? In production export as upstart job.
How would you do autocomplete and adding new items to the list without an association? like an open text field to add anything?
As suggested by Jean, changing null with 'form' makes things work!
mercury.html.erb
saveStyle: 'form', // 'form', or 'json' (default json)
Just saw that someone above has posted the same problem. Trying that solution.
With Rails 3.1.3 this does not seem to work. Mercury is escaping parameters. Here is a part of params hash:
Processing by PagesController#mercury_update as JSON
Parameters: {"content"=>"{\"page_name\":{\"type\":\"editable\",\"value\":\"about\",\"snippets\":{}},\"page_content\":{\"type\":\"editable\",\"value\":\"{\"page_name\":{\"type\":\"editable\",\"value\":\"about\",\"snippets\":{}},\"page_content
I googled and found a similar issue: https://github.com/jejacks0n/mercury/issues/85
Hi,
ad 1) yes, that's a Kaminari related issue. I guess it's trivial to define a
paginate
method, but nevertheless, there's a patch including thepaginate
methods for Kaminari based projects already.ad 2) I don't understand the issue here, ie. what is "including"
query do
. Best to submit an issue at Github.Technically, it should be possibly, when you'd use the
:load
option. Using filters and not using:load
is of course much more preferable.Hey all,
thanks to Ryan for the awesome screencasts. I've published a couple of refactorings and suggestions here:
where can I find a revised and updated demo/tut for something like Rails3.1.2 "polling-for-changes" like this great but not updated screencasts: http://railscasts.com/episodes/229-polling-for-changes?view=asciicast ?
answer also here if u want
http://stackoverflow.com/questions/8760791/where-can-i-find-a-revised-and-updated-demo-tut-for-something-like-rails3-1-2-p
thank you
I can't get any events to fire:
Notta :(
Hi Ed,
What problems have you found?
Already found it, I just forgot to add "has_many :branches" to the sector model. Really stupid...
For the "grouped_collection_select", where is the ":states" parameter created? I use this one (both @sectors and @branches are filled in the controller):
<%= f.grouped_collection_select(:branch, @sectors, @branches, :sector, :id, :branch, include_blank: true) %>
But receive an error:
(eval):1: syntax error, unexpected $end group.#<ActiveRecord::Relation
Wouldn't it make more sense to create a $JsProduct class object in an initializer and then call new on $JsProduct in the for_mustache method?
config/initializers/js_product.rb
models/product.rb
Did you add the CSS stylesheet to the list of assets to precompile in the production environment file?
Guys can some one help me, I found this error:
TypeError: Object 1,our first hello world,1,1,hola,1 has no method 'each'
That error was on the 8 line of my js.erb file
var lectures = new Array();
<% for lecture in @lectures -%>
lectures.push(new Array(<%= lecture.course_id %>, '<%=h lecture.title %>', <%= lecture.id %>));
<% end -%>
function courseSelected() {
course_id = $('#course_id').val();
options = $('#lecture_id').find("option");
options.length = 1;
lectures.each(function(lecture) {
if (lecture[0] == course_id) {
options[options.length] = new Option(lecture[1], lecture[2]);
}
});
if (options.length == 1) {
$('#lecture_field').hide();
} else {
$('#lecture_field').show();
}
}
$(document).ready(function() {
$('#lecture_field').hide();
$('#course_id').live('change', courseSelected);
});
Do some one was do it the same example with jQuery???
Hey guys this is the solution, match "javascripts/dynamic_states" => "javascripts#dynamic_states"
Ok, tried different things, but in the end I made an app/validators in my engine, and since all in app is (auto?) loaded, the validators from the engine are now loaded too.
Hmm.
A mi tambien me sucede lo mismo, lo que sucede al parecer es que en el recorrido del video Ryan Bates olvido modificar las rutas.
Agree with OP.
lib isn't autoloaded anymore.
Also, the blog post mentioned by tuscanidream doesn't explain how to get lib in engine to autoload. I think it would be good to autoload stuff from eninges, that don't belong in app. Or, make something like app/validators, which makes more sense to me.
Cheers
Ryan
blog_after and blog_before are not updated in download package
Incoming faxes? Wouldn't you need to have like a phone number or something? I don't think many people have the need to handle faxes.
Agreed, thnx!!
Any tips on daemonizing this thing?
It's January 2012 and this comment still delivers.
Nevermind, it automatically works if you use nested
fields_for
, like this (in Haml):From https://github.com/titanous/mailman/issues/19
Write a rake task that calls Mailman::Application.run and then use a heroku 'worker' to do this. Your rake task needs to be 'jobs:work'
http://devcenter.heroku.com/articles/queueing
+1