Hi
I'm creating a mountable admin engine (like Active Admin but not as
advanced) using Inherited Resources. Let's call it AdminFoo.
In my main app I mount it with mount AdminFoo::Engine, at: '/admin' in my
routes file.
Let's say I have the following structure in my engine:
*AdminFoo*
app
- vie
Phil:
>
>
> On Saturday, August 17, 2013 2:04:51 PM UTC-7, Linus Pettersson wrote:
>>
>> Hi
>>
>> Often when I build sites I need some way to track visits to specific
>> pages. For instance I need to see what Artists are the most popular so I
>> can l
Hi
Often when I build sites I need some way to track visits to specific pages.
For instance I need to see what Artists are the most popular so I can let
my users sort based on popularity.
I have used the gem Impressionist before but recently I ran into major
performance issues
(see https://git
Ok, this seem to work fine
@user.liked_photos.order("likes.created_at DESC")
Den fredagen den 9:e augusti 2013 kl. 10:55:39 UTC+2 skrev Linus Pettersson:
>
> Hi
>
> I have three models, User, Like and Photo.
> A User can like many Photos and a Photo can have many Liker
Hi
I have three models, User, Like and Photo.
A User can like many Photos and a Photo can have many Likers.
In my User model I have:
has_many :likes, foreign_key: "liker_id", dependent: :destroy
has_many :liked_photos, through: :likes
Like model:
belongs_to :liker, class_name: "User"
belongs_to
:developers, :name, using: 'btree')
>
> generates:
>
> CREATE INDEX index_developers_on_name ON developers USING btree (name) --
> PostgreSQLCREATE INDEX index_developers_on_name USING btree ON developers
> (name) -- MySQL
>
> Note: only supported by PostgreSQL and MySQ
Hi
I'm sorting some columns like this: MyModel.order("LOWER(column) ASC")...
But these queries are quite slow. I'm on Postgres by the way.
Does Rails support creating a lowercase index for these situations? I know
Postgres has support for it and I guess I can create one like this (found
on SO)
Hi
I want to use Sidekiq to run some jobs in the background. The jobs will be
created by the whenever gem (or similar) which creates a Sidekiq worker at
a specific time. This worker will in turn create a few hundred Sidekiq jobs.
So, I'm using Heroku and wonder if I need to use a separate worke
Hi
I'm building a small library to use in my Rails app which interacts with a
3rd party API. It fetches artists and tracks.
So I have:
lib/my_lib.rb
lib/my_lib/artist.rb
lib/my_lib/track.rb
To get an artist I do
artist = MyLib::Artist.find("Oasis")
Which returns an instance of Artist if it find
Ok, the solution was to not use #becomes and instead just set the type
field explicitly before saving.
//Linus
Den måndagen den 13:e maj 2013 kl. 10:19:08 UTC+2 skrev Linus Pettersson:
>
> Hi
>
> I'm using STI and want to convert one object to the other. The reason to
>
Hi
I'm using STI and want to convert one object to the other. The reason to
why I'm using STI is that I have a report and a full report. First someone
reports something and can only enter a few fields. Then and admin can
convert this into a full report and fill out the full report. Using STI
m
vient to have everything done and tested for you in gems
like Devise.
Any other thoughts on this subject?
Den tisdagen den 7:e maj 2013 kl. 03:56:33 UTC+2 skrev tamouse:
>
> On Mon, May 6, 2013 at 12:38 PM, Linus Pettersson
> > wrote:
> > Hi!
> >
> > I wat
Hi!
I watched this video the other day: http://vimeo.com/39498553
where they argue that it may be a better idea to roll your own
authentication solution using has_secure_password instead of using, for
instance, Devise.
I started a new project using Rails 4 today and need authentication. I'm
th
Thank you. I thought strong params needed symbols.
Cheers,
Linus
Den fredagen den 8:e mars 2013 kl. 10:35:13 UTC+1 skrev Jordon Bedwell:
>
> On Fri, Mar 8, 2013 at 3:27 AM, Linus Pettersson
> > wrote:
> > Hi
> >
> > I have an hstore field in my database wh
Got it myself! Splat operator to the rescue :)
params.require(:foo).permit(*Foo::DOCUMENT_FIELDS.map(&:to_sym))
Den fredagen den 8:e mars 2013 kl. 10:27:50 UTC+1 skrev Linus Pettersson:
>
> Hi
>
> I have an hstore field in my database where I store a lot of different
>
Hi
I have an hstore field in my database where I store a lot of different
fields.
I still want getters, setters and validations for my fields so I've created
an array with the fields like this:
DOCUMENT_FIELDS = %w[foo bar baz]
Then I do some meta programming to create getters and setters:
Hi
I have created a polymorphic association for comments since I need
commenting functionality on several models. The issue is that when I create
the comment in my Commets#create action, I really don't know what type the
parent is of.
So, let's say I have Foo, Bar and Comment. Comment have thi
Hi
Let's say I have three models, Company, User and Entry (and a join model
EntryParticipants).
Company has many Users, a User has many Entries (Entries created by a User).
Also, there is another many-to-many relationship between User and Entry (a
User can participate in many entries and an Ent
s
Or am I wrong? :)
Den måndagen den 18:e februari 2013 kl. 11:24:04 UTC+1 skrev Linus
Pettersson:
>
> That is true. I'll probably change this.
>
> This doesn't solve my problem though. I realize that I phrased myself a
> bit odd in my first post I will clarify below.
raint for this on the relation
itself to get the correct users automatically etc.
Den måndagen den 18:e februari 2013 kl. 11:00:21 UTC+1 skrev Colin Law:
>
> On 18 February 2013 09:44, Linus Pettersson
> >
> wrote:
> > Hi
> >
> > I have a model, let'
Hi
I have a model, let's call it entry, that belongs to a user. The user and
the entry also belongs to a company.
Can I add a condition on the belongs_to relations to check this?
Something like:
belongs_to :assigned_user, class_name: "User" , conditions: { company_id:
company_id }
This doesn'
Found the error... I have written t.belongs in one class instead of
belongs_to Tired...
Den fredagen den 8:e februari 2013 kl. 15:28:16 UTC+1 skrev Linus
Pettersson:
>
> Hi
>
> I'm trying to create a many to many relationship between two models.
>
> A User can
Hi
I'm trying to create a many to many relationship between two models.
A User can be associated with many Incidents and vice versa.
class User < ActiveRecord::Base
include ActiveModel::ForbiddenAttributesProtection
has_many :incident_participants, foreign_key: "participant_id"
has_many :
First, install rbenv/ruby-build or RVM
https://github.com/sstephenson/rbenv/
https://github.com/sstephenson/ruby-build
or
https://rvm.io/
Then install ruby 1.9.3
Then install rails
Good luck!
Den tisdagen den 5:e februari 2013 kl. 08:37:23 UTC+1 skrev Ruby-Forum.com
User:
>
> Hi guys
>
> I'm
And actually, it is used in my controllers as well :)
Den söndagen den 3:e februari 2013 kl. 13:23:28 UTC+1 skrev Linus
Pettersson:
>
> Hi!
>
> If I have a method that is useful in both models and in views, where would
> be the appropriate place to put it?
>
> The method i
Hi!
If I have a method that is useful in both models and in views, where would
be the appropriate place to put it?
The method in question just takes two dates as strings, tries to parse them
and returns all dates in the range between them. It also takes care of the
issues when the dates are ba
d_at.to_date }
end
And then just use visits[date].count for the counting. There will probably
not be that many records anyway...
Den tisdagen den 29:e januari 2013 kl. 17:26:00 UTC+1 skrev Linus
Pettersson:
>
> Hi!
>
> I have a table with visits with a visited_at: attribute which i
Hi!
I have a table with visits with a visited_at: attribute which is a datetime
field. They seem to be stored as UTC. Now I want to count all visits each
day and return something like:
{
2013-01-01: 8,
2013-01-02: 4,
2013-01-07: 9,
...
}
So, I did it like this which kind of works...:
Hi!
I have a model which has a field that can have three values only. I store
the value in the database as an integer, 0, 1 or 2, but when I display it I
want a more appropriate text. And, I want it to be translatable using i18n.
Let's say that it corresponds to how difficult something is. So,
Another option would be to fetch the raw JSON data using javascript from
.../events.json and then do the grouping and whatever client-side and pass
to the graph... Maybe too inefficient?
// Linus
Den fredagen den 25:e januari 2013 kl. 10:35:40 UTC+1 skrev Linus
Pettersson:
>
> Hi!
&
Hi!
I'm creating a bar graph using Morris.js. What I'm showing in the graph is
dates on the X-axis and the number of times an event has occurred on that
date on the Y-axis.
So, I followed Ryan Bates episode on
Morris.js: http://railscasts.com/episodes/223-charts-graphs-revised (It's a
PRO epi
Hi!
If I'm starting to develop a website soon, would you recommend me to use Rails
4? I guess a release is not THAT far away, so it will probably be released
before my site is done...
So, start with rails 4 or use 3.2 and upgrade later?
How stable is rails 4 atm?
Cheers!
Linus
--
You receiv
What path do you get? It should be something like
"/organizations/:id/projects/new". This is where you can add a form for
example to add a new project.
Do you try to POST to that path above? If so, that's wrong (it's for GET
requests). Read more about nested resources here:
http://guides.rubyon
file remove the line:
>
> require 'rails/all'
>
> and include only the railties you need excluding test unit
>
> Regards.
>
> 2012/8/28 Linus Pettersson >
>
>> Hi!
>>
>> I have an app that uses Rails 3.2.7. I want to use minitest-rails (
>> http
Hi!
I have an app that uses Rails 3.2.7. I want to use minitest-rails
(https://github.com/blowmage/minitest-rails) instead of test_unit. I have
installed it and it works fine. The problem is when I generate something,
say a model, it still uses the test_unit generators and NOT minitest.
So, I
Hi!
When I'm creating an application for a project of my own I usually use
Active Admin or something for my admin area and code everything else
myself. The backend interface is not always perfect but it's OK because
only I will use it. The few quirks and weird stuff is OK because I know how
ev
My bad, it does NOT work!
Den söndagen den 29:e juli 2012 kl. 20:04:14 UTC+2 skrev Linus Pettersson:
>
> Actually, I think I found a solution now.
>
> I first parse it, like:
> uri = URI.parse(the_url)
> and then:
> redirect_to uri.to_s
>
>
> Works :)
>
>
>
Actually, I think I found a solution now.
I first parse it, like:
uri = URI.parse(the_url)
and then:
redirect_to uri.to_s
Works :)
Den söndagen den 29:e juli 2012 kl. 19:30:58 UTC+2 skrev Hassan Schroeder:
>
> On Sun, Jul 29, 2012 at 10:09 AM, Linus Pettersson
> wrote:
>
&
I mean, URI.parse(uri) doesn't return any error on either of the URIs it
seems.
Den söndagen den 29:e juli 2012 kl. 19:44:48 UTC+2 skrev Linus Pettersson:
>
> Thank you for your time.
>
> How can I check if the URL is "good" or needs to be encoded?
>
> Best R
Thank you for your time.
How can I check if the URL is "good" or needs to be encoded?
Best Regards
Linus
Den söndagen den 29:e juli 2012 kl. 19:30:58 UTC+2 skrev Hassan Schroeder:
>
> On Sun, Jul 29, 2012 at 10:09 AM, Linus Pettersson
> wrote:
>
> > I need t
rails -v
in console.
Den söndagen den 29:e juli 2012 kl. 19:08:58 UTC+2 skrev Ruby-Forum.com
User:
>
> How can I confirm that kind let me know
>
> --
> Posted via http://www.ruby-forum.com/.
>
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Tal
Hi!
I need to redirect to some 3rd party websites. The issue is that some of
the urls works to redirect and some doesn't work, using redirect_to url
Example 1:
http://example.com/click?a(999)p(999)prod(99)ttid(999)url(http%3A%2F%2Fwww.someothersite.se%2Fd%2FBLah-Fooo%2FBar%2F_%2FA-3z
At least they should fix the ones that are incorrect...
"Octopus".pluralize should return "Octopuses" and NOT "Octopi"... :)
Den torsdagen den 19:e juli 2012 kl. 20:23:15 UTC+2 skrev davidcelis:
>
>
>
> On Thursday, July 19, 2012 11:22:40 AM UTC-7, davidcelis wrote:
>>
>> For anybody who shares
No...but that's generating the same as grouped_collection_select() but
without the wrapping tag so that doesn't work...
Den tisdagen den 19:e juni 2012 kl. 19:55:43 UTC+2 skrev Ruby-Forum.com
User:
>
> Linus Pettersson wrote in post #1065179:
> > Hi!
> >
Hi!
I have categories and subcategories. Now I want to create a select tag with
this data so a user can select either a category or a subcategory. What I
tried first was to use grouped_collection_select and use the main
categories as groups and list the subcategories inside. Visually, this is
You can read more about rendering JSON here:
http://guides.rubyonrails.org/action_controller_overview.html#rendering-xml-and-json-data
Den söndagen den 17:e juni 2012 kl. 20:17:32 UTC+2 skrev Ruby-Forum.com
User:
>
> Thank you guys for the answer, but I just did this:
>
> render :json => Active
Have you added
*require* 'csv'
?
Den lördagen den 9:e juni 2012 kl. 19:07:49 UTC+2 skrev Ruby-Forum.com User:
>
> Colin Law wrote in post #1063851:
> > On 9 June 2012 16:42, Anders Andrew wrote:
> >> I am quite new to Rails, so nothing fancy. Preferably some basic code
> in
> >> View, Cont
u.update_attributes(...) is a method and you give it a hash as parameter
u.attributes = ... just assigns the attributes variable with a hash.
Den onsdagen den 25:e april 2012 kl. 21:15:36 UTC+2 skrev Ruby-Forum.com
User:
>
> So why the = sign in the first example?
>
> --
> Posted via http://w
To run the first code you tried you need to add the .erb extension.
Otherwise, it's like running ruby code in a css/html file or whatever. It
doesn't work :)
The assets pipeline works like this:
example.css.scss => Interprets scss first and serves the css file.
example.html.erb => interprets erb
ou a
> project idea, and i'd be happy to help.
>
> Alecs
>
>
> On Apr 5, 2012, at 7:20 PM, Linus Pettersson wrote:
>
> ity student (Masters) and this summer I will probably not have an ordinary
> summer job, but instead work on some of my own projects. These will
Hi!
I'm a swedish university student (Masters) and this summer I will probably
not have an ordinary summer job, but instead work on some of my own
projects. These will probably not fill my time so now I want some ideas for
a project to start or a gem to develop in Rails.
Do you have any servic
>
> Is_A and Has_A relationships. Describe the relationship between the forms
>
>
> On 4 April 2012 14:42, Linus Pettersson <> wrote:
>
>> Hi!
>>
>> I have created a nested form and now I want to make it dynamic. I have
>> two models, "Appli
Hi!
I have a nested form with Applications and Participants. One application
can have many participants. Now I want to be able to dynamically (using JS)
add fields for the Participants in the Applications form.
I'm a bit lost on how to do it though... I did watch some videos on
RailsCasts (#196
Hi!
I have created a nested form and now I want to make it dynamic. I have two
models, "Applications" and "Participants". Each application may have
several participants, but at least one which is the contact person. An
issue that I have is that when the form is not validated it renders the
par
Hi!
I'm creating a simple signup form where people can sign up for a camp. They
should be able to add a contact person and also sign up other people (such
as family members).
Two models:
Application
has_many :participants
accepts_nested_attributes_for :participants
Participant
belongs_to
Well a link_to creates a regular link in HTML so you need to style the a
tag.
#table-3 th a {
color: .
}
Or if you want to style both regular text and links in that part:
#table-3 th,
#table-3 th a {
color: ...
}
Den onsdagen den 29:e februari 2012 kl. 19:16:51 UTC+1 skrev Ruby-Forum.c
Yes, but the code in the search view is not executed again when the AJAX
request is fired :)
So, you have to do the check in your loader.js.erb and not the search view.
Something like this should work:
<% if @group_trace %>
$('#loader_div').html("<%=j render(@group_trace)%>");
<% end %>
Cheers
Yep, or:
Photo.find(123).update_attribute(:title => "New great title")
Regards
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/-0h5vJWe_s4J.
To
Well, the code in the search view is executed when the view is rendered. It
is not executed again when you inject the html using javascript.
So the if @group_trace code is only executed when the search view is
rendered and @group_trace is not created yet.
What are you actually trying to achieve
Well, you go here, right?
yourapp.com/search ?
Then the @group_trace is nil because it's not created until you run the
loader action.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discussion on the web visit
https://grou
Is that even possible? I don't think so...
I'd say that the best way is to reset all the passwords, notify them and
allow them to change it.
Linus
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discussion on the web visit
This query is only to get the appropriate Categories & Subcategories. There
are 5 Categories and 45 Subcategories.
My products are imported from webshops which are using different categories
for the same things ("tshirt", "t-shirts", "t-shirt", "short sleeved
shirts" may all be the same). To co
Also, another reason for the query that I forgot to mention is that if a
user filters the products for female products only for instance, it should
only show categories and subcategories that contains products for that
gender.
The gender is specified in the products table...
--
You received t
Hi
I tested to remove the .order(...) part and indeed, the query time goes
down to ~100ms. However, it doesn't help to add indices, at least not as I
did :)
add_index :categories, :name
add_index :subcategories, :name
Did some more testing and if I keep the .order... but don't join the
produc
Well, maybe it's not necessary... It is the slowest of my queries as far as
I can see anyway.
I'm using Rails 3.2 and I have enabled automatic EXPLAIN on slow queries
(>0.5s). This query is currently being "explained" in my console when I run
it on my localhost. "SQL (556.5ms) ..."
556.5ms see
Thank you. I have added the generated SQL to the snipt in my first post.
Regarding the EXPLAIN ANALYZE, can I somehow run that on Heroku? I'm using
their shared database so I don't have access to any psql console...
I did run it on my local machine though. The thing is that it differs in
databa
Hi!
I'm trying to speed up some queries in my app, running Rails 3.2 and need
some help. I'm running the app at Heroku on postgresql. I'm new to
postgresql and need some help to optimize a query so it effectively uses
indices.
This is the query I'm currently working on:
http://snipt.net/Linuus
That is correct. The .js (or .js.coffee if using coffeescript) files should
be in app/assets/javascript/.
You could use require tree which is specified from the beginning and will
include all javascript files. I do prefer to require each file separately
though as it gives me more control.
Chee
As it says in application.js:
"
// This is a manifest file that'll be compiled into including all the files
listed below.
// Add new JavaScript/Coffee code in separate files in this directory and
they'll automatically
// be included in the compiled file accessible from
http://example.com/assets
Hi again!
I posted a question about this issue on StackOverflow and got an
interesting response. To force Rails to join the included table you can use
eager_load() instead of includes(). Using eager_load() and removing the
group() seems to make my query work perfect.
Correct version:
Category
Wow! Thank you for all the help Peter! I really appreciate it. I will test
that code tomorrow as it's getting quite late here.
I did a small test now though. It seems that you can't mix joins and
includes.
This doesn't work:
Category.includes(:subcategories).joins("INNER JOIN resellercategories
Hi Colin!
Absolutely. You mean for the models?
Here they are:
http://snipt.net/Linuus/category-and-subcategory?key=38ba590408ac4233927a06046eeca30d
Best Regards
Linus
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discuss
Still doesn't work :(
Generated SQL:
" SELECT "categories".* FROM "categories" INNER JOIN resellercategories AS
r ON subcategories.id =
r.subcategory_id INNER JOIN products AS p ON r.id = p.resellercategory_id
WHERE (p.gender = 'unisex' OR p.gender = 'male')
AND (subcategories.id > 0) GROUP BY
(I wrote an answer before but it seems to not have been published so here
we go again :) )
No, there is no LEFT OUTER JOIN subcategories... I guess this is because I
don't have any condition on the subcategories. Then it will execute two
queries instead of using the LEFT OUTER JOIN.
I just ran
You have to use Javascript for that.
Why do you want to do this anyway? If you just want to combine "First" and
"Last" to one string "First Last", do it when you receive the data in the
controller or model.
Regards
Linus
--
You received this message because you are subscribed to the Google Gr
Also, just to be clear. You are totally right that I just do
"mc.subcategories.each"...
This is what the view looks like:
http://snipt.net/Linuus/categories-view-1?key=8f1be321f6253bd74847066a719490ce
Regards
Linus
--
You received this message because you are subscribed to the Google Groups "R
Thank you Peter. I also found the related section in the rails guides about
this:
http://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations
However, I haven't gotten it to work just yet. The above example you wrote
doesn't work because that subcategories.id is not pre
Man, I'm beating my head against this one...
The query above is probably not the best. Any other suggestions?
Regards
Linus
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.
Hi!
I have an app that manages products. I import the products from several
resellers and they all name their categories different. Because of this I
have resellercategories that are mapped to my own subcategories.
Categories
- Subcategories (belongs_to Category)
Resellercategories (belongs_to
Thank you.
I got the scopes working so now I can skip the extra field :)
Best Regards
Linus
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/_4K
Thank you Peter. I have some follow up questions.
Let's say I would use a scope. How could I do that? (let's ignore the
"image_small" for now and focus on the subcategory) There is nothing in the
product table that I can use to select the completed products. It is only
regarded as completed if
Hi!
I have an app with products, categories, subcategories and
resellercategories.
Products
belongs_to :resellercategory
has_one :subcategory, :through => :resellercategory
has_one :category, :through => :subcategory
So, there are a lot of resellercategories that are (manually) mapped to m
I see.
Thank you very much Peter!
Regards
Linus
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/H8RtP69UakQJ.
To post to this group, send email
Hi!
I just pushed an app to Heroku for the first time. I notice that the
ordering is not quite correct. It is on my local machine though.
The issue is that the swedish characters Å Ä and Ö are ordered like A A and
O. I guess this is because some collation or locale is wrong.
Any ideas on how to
Hi!
In Rails 3.1 there is only one method for migrations called 'change'.
I want to run some code in a migration only when migrating up, not down. Is
that possible?
The issue I have is that this code is inside a migration file from Active
Admin:
# Create a default user
AdminUser.create!(:emai
You could use formtastic. It uses inline error messages for the fields.
https://github.com/justinfrench/formtastic
Also, it's awesome :)
Regards
Linus
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discussion on the web vi
Of course... Thank you! Sometimes when you've looked for too long on the
code you get blind :)
Regards
Linus
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyo
Hi!
I'm using Rspec and factory_girl. In my products model I have a method that
creates permalinks simply by overriding to_param, like this:
def create_permalink
self.permalink = "#{self.name} #{self.brand.name}".parameterize
end
My product factory looks like this:
Factory.define :product do
Hi!
I'm importing lots of products via XML. Some characters like the swedish å,
ä, ö are encoded as å for instance. When I print it I just append
.html_safe to make it appear correct.
Is this a good and safe approach or should I convert the characters in some
other way?
--
You received this
You need to get the current value from the params hash. Something like this:
<%= select_tag :gender, options_from_collection_for_select(@genders, "value",
"name", params[:gender]), :include_blank => true %>
Notice the params[:gender].
Regards
Linus
--
You received this message because you are
Maybe it is better to just create two models/controllers and nest them?
That way I get restful routes easily.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyo
I have an application, built with Rails 3.1.3, that has products and
categories. The categories are related to other categories, so a category
can be a parent or a child category. The products are then related to a
child category.
Now, I'm thinking about how I should define the routes. Is it a
Ok, thank you guys.
Hasn't some other gems changed? Like some of these:
gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
Are these still the default in 3.1.3?
Regards
Linus
--
You received this message because you are subscribed to the Google Groups "Rub
Hi!
The app that I'm developing is based on Rails 3.1.1. Now 3.1.3 has been
released. I'm a bit new to rails so I'm not sure how to safely do the
upgrade.
- How do I upgrade my app from Rails 3.1.1 to 3.1.3?
Regards
Linus
--
You received this message because you are subscribed to the Google
Yes, of course. This was only in an Admin interface where I will need to
quickly select a dropdown only for each post. It is very tedious to select
and then click a button when you might need to do it like a couple of
thousand times :)
I use Active Admin which comes with an old jQuery / rails j
Hi!
I have a small form that I want to submit through AJAX when a dropdown is
changed. I have set the form to be :remote => true.
But if I do something like:
$('.element').change ->
this.form.submit()
The form is not submitted through AJAX. Can I trigger Rails ajax submit
function someho
Thank you for the answer!
Yes, I was thinking about just having the reseller categories (raw
categories) as a lookup table. So for each product I import I just check
what category it should be in.
One issue with this is that it might get a bit messy if I would change the
relations between a res
Hi!
I'm creating an app that will import products from several XML feeds. In
the XML there is a category specified, like T-Shirt for instance. The
problem is that different resellers specify the categories differently. For
instance, what one reseller calls "T-Shirts" another may call "T-Shirt",
Well, yes but that's not the point.
Items have a status field. Lists has many items.
When displaying a List as JSON I want it to have an attribute that counts
how many finished items there are in the list and how many unfinished items
there are in the list. The above methods only fetches the ite
I already have done that, like this:
def unfinished_items
self.items.where("status = ?", false)
end
def finished_items
self.items.where("status = ?", true)
end
So I can use the List.unfinished But how do I add it as attributes to
the json output?
--
You received this message b
1 - 100 of 125 matches
Mail list logo