What is the purpose of the :type column for the User model in the STI example? I don't see the point of this, a User record is never even instantiated?
in Ryan's example, how can I pass a querystring parameter to the datatable class? so if the url is /logs it displays all logs but if it is /logs?product_id=1, it will only display logs for the product with id = 1
When you're auto generating your 3 questions be sure to make the fields_for line visible using <%= instead of just <% otherwise you won't see the 3 questions.
You can also use zeus as alternative to spork: https://github.com/burke/zeus
Comparing to spork it has zero configuration and speed up not only tests executing but all rails commands as well:
zeus console, zeus server, etc.
While this comment is 3 months old, I had to chime in on this:
I also typically do auth from scratch, but have lost a job possibility based on that. They felt I was a 'lone wolf' for doing my own auth, and were afraid I could not work well with a team (You know, even though I have worked on teams up to almost a hundred people).
Yes, it probably said a lot about the company and was probably a good warning indicator that that might not be the best company in the world to work for.
The problem is that rails asset pipeline will minify your javascript and rename variable names. So you need to pass arguments as strings in the array:
@App = angular.module("App", ['ui', 'ngCookies', 'ngResource']).config(["$routeProvider", ($routeProvider) ->
So if it displays well in your example it throw errors when filtering server-side with an error "JSON data from server could not be parsed. This is caused by a JSON formatting error"
Is there anybody who knows how to return the well formatted JSON ?
Any help would be appreciate
When I recently tried implementing this, I landed up with the error "attribute" is marked as readonly . Here, the "attribute" refers to the counter cache attribute. To fix the same, this post helped me.
how is it possible to a repeat a step? I've combined this Railscast with the Railstcast dealing with nested attributes.
For example: In the first form I will create a question. In the next step I will create an answer and can choose between "Create a 2. Seconds Answer" or "Finish". If I choose to create a second or third answer this should happen in a new form until I decide to finish this record.
I find the way validation errors are displayed in the third solution a bit odd. The validation error is always the same for each product, isn't it? Might as well display it only once then. Or am I missing something here?
+1. Just hang in there. I was getting nervous because the server had actually been running (green light in the UI) on AWS for awhile. It did eventually kick in.
Absolutely unbelievable. My partner and I just finished building this very type of functionality into an app. It took us months to figure out a plausible approach, and here it is in 15 minutes. Someone give this man a medal.
I also have an issue, but with the SQL that is produced by the relationship between User and micropost (like haiku in the Railscast).
I posted it on stack overflow, would love it if someone could help.
Is there a way to follow this same direction for a partial? My view starts with a form that passes params back to the same URI which formats a partial. I'm struggling to make this lesson translate to my scenario. Advice? Ideas?
Could be my setup but Mercury is running 'onload' twice. i had to do one of these:
ruby
var link = $('#mercury_iframe').contents().find('#edit_link');
if (typeof link.data('save-url') != 'undefined') {
console.log('only set saveUrl if it exists');
Mercury.saveUrl = link.data('save-url');
}
console.log(Mercury.saveUrl); //<-- should be valid
link.hide();
For an indented Ember-compatible alternative to Handlebars templates, you can try Emblem.js
It does break nginx to return the wrong header, so it's definitely worth fixing.
What is the purpose of the :type column for the User model in the STI example? I don't see the point of this, a User record is never even instantiated?
Hah!
How to make this login work on page tab?
In my controller i am using following code to authenticate and to create current_session.
person = authenticate_person!(:recall => "sessions#new")
@current_user = person
but
person = Authentication.find_or_create
& @current_user = person
not working for me, did i miss something?
http://stackoverflow.com/questions/15159926/how-to-authenticate-ready-application-with-omniauth
Thanks for letting us know, I've corrected the text in the ASCIIcast :)
FYI:
Typo: "The Backbone generator has added underscore, which is one of Backbone’s dependencies, backbone itself and out newly-"
out s/b "our"
in Ryan's example, how can I pass a querystring parameter to the datatable class? so if the url is /logs it displays all logs but if it is /logs?product_id=1, it will only display logs for the product with id = 1
resources :products do
put :discontinue,:on => :collection
end
tried this already and still doesn't work. Any other options? I also added this outside of any groups and still getting the same error
All those who come later:
When you're auto generating your 3 questions be sure to make the fields_for line visible using <%= instead of just <% otherwise you won't see the 3 questions.
I'm using Rails 3.2 in case it matters.
Good hunting,
Mike
Thank you for this! I was getting very frustrated with not being able to get even the example to work correctly and this solved my problem.
Thanks, this is very useful site.
the import is seemingly working ok for me but then the values of the attributes are saved as nil. any thoughts?
INSERT INTO "addresses" ("baths", "beds", "building_name", "city", "created_at", "date_available", "full_address", "laundry_in_building", "laundry_in_unit", "listing_notes", "parking", "pets", "price", "showing_contact", "showing_contact_number", "showing_instructions", "state", "status", "unit_number", "updated_at", "utilities_included", "zipcode") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22) RETURNING "id" [["baths", nil], ["beds", nil], ["building_name", nil], ["city", nil], ["created_at", Sun, 03 Mar 2013 16:52:17 UTC +00:00], ["date_available", nil], ["full_address", nil], ["laundry_in_building", nil], ["laundry_in_unit", nil], ["listing_notes", nil], ["parking", nil], ["pets", nil], ["price", nil], ["showing_contact", nil], ["showing_contact_number", nil], ["showing_instructions", nil], ["state", nil], ["status", nil], ["unit_number", nil], ["updated_at", Sun, 03 Mar 2013 16:52:17 UTC +00:00], ["utilities_included", nil], ["zipcode", nil]]
You can also use zeus as alternative to spork:
https://github.com/burke/zeus
Comparing to spork it has zero configuration and speed up not only tests executing but all rails commands as well:
zeus console, zeus server, etc.
It is possible to have more than one delayed job process doing the same task on the same server?
While this comment is 3 months old, I had to chime in on this:
I also typically do auth from scratch, but have lost a job possibility based on that. They felt I was a 'lone wolf' for doing my own auth, and were afraid I could not work well with a team (You know, even though I have worked on teams up to almost a hundred people).
Yes, it probably said a lot about the company and was probably a good warning indicator that that might not be the best company in the world to work for.
The problem is that rails asset pipeline will minify your javascript and rename variable names. So you need to pass arguments as strings in the array:
@App = angular.module("App", ['ui', 'ngCookies', 'ngResource']).config(["$routeProvider", ($routeProvider) ->
EDIT
the requested 2D array expected by DataTables should be read with ' " ' (double quotes) around the right side of the pair for each attributes
Hello
It appears that the JSON array returned is not what is expected by DataTables.
Let say for a model User where mapping returns user.id, user.last_name, user.first_name, user.email...
the returned JSON is
wich is a one dimension array, and the 2 dimensions arraay expected by DataTables (for the aaData part) should be for the same set of data
So if it displays well in your example it throw errors when filtering server-side with an error "JSON data from server could not be parsed. This is caused by a JSON formatting error"
Is there anybody who knows how to return the well formatted JSON ?
Any help would be appreciate
see this SO question for details on my problem: http://stackoverflow.com/questions/15121588/rails-3-export-csv-from-partial
Exactly what I needed. Thanks Jaime!
Products could have validations like: price can't be lower than 2.99 if the category is "Games" - or something like that :)
I found a great unicorn init.d script working with
rvm
instead ofrbenv
.RVM init.d script
Cheers everybody,
I suspect he's using Turbolinks which is explained in an earlier railscasts.
I highly recommend it as well. It is stupidly easy to implement and will be adopted in rails 4.0 if I recall correctly.
I had to add a comma at the end of path_names in my routes.rb else the server kept giving me a syntax error at this point:
controllers: {
Great tutorial btw - thanks a ton!
thanks, helped me a lot. +1
Try
Cheers
Hello Pramsay
I know this post is a bit old but did you solved your problem ? I'm facing the same wall and can't find solution
Does anyone found a way to cancel a single upload ?
I did some research and I couldn't find the solution.
Thanks Mr Bates for your great screencasts.
+1
When I recently tried implementing this, I landed up with the error "attribute" is marked as readonly . Here, the "attribute" refers to the counter cache attribute. To fix the same, this post helped me.
Hi,
how is it possible to a repeat a step? I've combined this Railscast with the Railstcast dealing with nested attributes.
For example: In the first form I will create a question. In the next step I will create an answer and can choose between "Create a 2. Seconds Answer" or "Finish". If I choose to create a second or third answer this should happen in a new form until I decide to finish this record.
Best Regards,
Ben
I find the way validation errors are displayed in the third solution a bit odd. The validation error is always the same for each product, isn't it? Might as well display it only once then. Or am I missing something here?
I agree Richard, I only use Rails Composer when starting a new Rails app.
An if it does, how it works? Does it re-minified applications.js, I thought that application.js was cached through all requests.
Thanks,
alfredo
thank you! your tip helped me :)
Does Gon work on production, when asset pipeline is on and js minified?
+1. Just hang in there. I was getting nervous because the server had actually been running (green light in the UI) on AWS for awhile. It did eventually kick in.
This is more of a papertrail, not activity tracking.
It is articles_controller.rb not calendars_controller.rb
usersdatatable.rb
Absolutely unbelievable. My partner and I just finished building this very type of functionality into an app. It took us months to figure out a plausible approach, and here it is in 15 minutes. Someone give this man a medal.
Saving works, but there is no redirect when saving. Anyone else having this issue?
I also have an issue, but with the SQL that is produced by the relationship between
User
andmicropost
(likehaiku
in the Railscast).I posted it on stack overflow, would love it if someone could help.
This also works (IMO is preferred) in rails 3.2
Is there a way to follow this same direction for a partial? My view starts with a form that passes params back to the same URI which formats a partial. I'm struggling to make this lesson translate to my scenario. Advice? Ideas?
I am not quite familiar with the concept of Presenters. Can you recommend any articles/videos on the topic?
Could be my setup but Mercury is running 'onload' twice. i had to do one of these: