Namespace it? Product::Action for the model, and
product_action_path(@instance_var) in the routes.
On Wed, Mar 5, 2014 at 12:32 PM, Walter Lee Davis wrote:
> I need to use the model name 'Action' (which will not work in Rails 4.0.3)
> for business reasons (it's a product name). If I name the act
I need to use the model name 'Action' (which will not work in Rails 4.0.3) for
business reasons (it's a product name). If I name the actual model something
else, is there any way to (maybe with mod_rewrite) make the URL appear the way
I need it to while keeping everything working in Rails?
I've
Use permitters instead. Easily testable.
On Mar 5, 2014 3:26 AM, "bertly_the_coder" wrote:
> LOL! Thx Dave.
>
> Anyone else figured/figuring this out or found some documentation about it?
>
> On Tuesday, March 4, 2014 10:02:50 PM UTC+3, Dave Aronson wrote:
>>
>> On Tue, Mar 4, 2014 at 1:13 PM, be
Initially, I was using this query:
report_ids = []
if units.size > 0
units.map(&:id).uniq.each do |id|
report_id = Report.select(:id).where(unit_id: id).order("time
desc").first
unless report_id.nil?
report_ids << report_id
end
end
end
On Tuesday, March 4, 2014 12:04:46 PM UTC-5, Steven Cahill wrote:
>
> Thanks Rick
>
> on the actual categories page the categories are listed in category_id
> order correctly, I have the following code in my controller
>
> # GET /categories
> # GET /categories.json
> def index
> @cate
LOL! Thx Dave.
Anyone else figured/figuring this out or found some documentation about it?
On Tuesday, March 4, 2014 10:02:50 PM UTC+3, Dave Aronson wrote:
>
> On Tue, Mar 4, 2014 at 1:13 PM, bertly_the_coder
> >
> wrote:
>
> > They all pass. That's the problem. Mass-assignment
> > doesn't se
On Tuesday, March 4, 2014 2:54:38 PM UTC-5, Ruby-Forum.com User wrote:
>
> Hi,
>
> Thank you for your reply. I only have one admin on the website as shown
> below (code taken from seeds.rb).
>
> User.create(:name => "weds4u", :password => "w", :password_confirmation
> => "w", :role => 'admin'
Hi,
Thank you for your reply. I only have one admin on the website as shown
below (code taken from seeds.rb).
User.create(:name => "weds4u", :password => "w", :password_confirmation
=> "w", :role => 'admin')
User.create(:name => "Afsheen", :password => "a",
:password_confirmation => "a", :role =
Ganesh Ranganathan wrote in post #1138798:
> You can use a before_action filter in the controller to check both the
> current user's permissions and the user he is about to delete.
>
> And if it is another admin user or himself, then redirect them to
> another
> page with a flash error message. Mor
You can use a before_action filter in the controller to check both the
current user's permissions and the user he is about to delete.
And if it is another admin user or himself, then redirect them to another
page with a flash error message. More details at the filter link below
http://guides.ruby
Hello,
I am a second year undergrad designing a ruby on rail program for
wedding.
I am struggling so much with lots of code but one main thing which I
don't understand how to do is to make sure that if the administrator has
the rights to delete any registered users, then they don't delete their
o
On Tue, Mar 4, 2014 at 1:13 PM, bertly_the_coder wrote:
> They all pass. That's the problem. Mass-assignment
> doesn't seem to get caught by the testing environment.
Ah, yes, that is odd. Maybe you could check out the tests from that
part of Rails, or of the strong_parameters gem, and see how t
How an I make the code below only show "no new messages" once rather
than multiple times when there are multiple tickets?
%tbody
- @users_tickets.each do |t|
- unless t.ticket_replies.empty?
%tr
%td= t.business.name
%td= link_to "#{t.c
They all pass. That's the problem. Mass-assignment doesn't seem to get
caught by the testing environment.
On Tuesday, March 4, 2014 8:13:03 PM UTC+3, Dave Aronson wrote:
>
> On Tue, Mar 4, 2014 at 8:49 AM, bertly_the_coder
> >
> wrote:
>
> > Has anyone figured out how to test strong parameters
I keep getting this type of error, and have researched this for weeks on
the internet. tried every suggestion and it still persists..
An ActiveRecord::StatementInvalid occurred in customer#go_to_consultation:
Mysql2::Error: Lost connection to MySQL server during query: SELECT
`users`.* FRO
On Mar 4, 2014, at 10:04 AM, Steven Cahill
wrote:
> def index
> @categories = Category.order('id asc')
> end
>
> The only problem is the navigation list that I have put into the application
> layout page seems to have a mind of its own, here is the code for
So why are you using Catego
Hi Steve:
Try the following:
<% Category.order("id DESC).each do |category| %>
rather than Category.all ...
See http://guides.rubyonrails.org/active_record_querying.html#ordering
Don Ziesig
On 03/04/2014 12:04 PM, Steven Cahill wrote:
Thanks Rick
on the actual categories page the categorie
On Tue, Mar 4, 2014 at 8:49 AM, bertly_the_coder wrote:
> Has anyone figured out how to test strong parameters?
You mean test the concept itself, or test that your usage of it does
what you intend? I haven't done so, but offhand, I would guess you
could do that by testing a few requests with go
On Mon, Mar 3, 2014 at 4:01 PM, Brandon wrote:
> This is what my User/Create looks like after rethinking my controller. Does
> it need more work to make it slimmer?
I've seen (and even made) much worse, but this can be slimmed down
fairly easily. The sign_in and that big if-statement, have noth
Thanks Rick
on the actual categories page the categories are listed in category_id
order correctly, I have the following code in my controller
# GET /categories
# GET /categories.json
def index
@categories = Category.order('id asc')
end
The only problem is the navigation list that
Put your code on github. It could be a good oportunity to you train git,
and for us, is an easier way to know what the context of your problem...
First, I recommend to read that: http://guides.rubyonrails.org/routing.html
Second... try plan better your routes. It's not related with your currently
The simplest multiple file upload I have seen is using the browser-native
method of applying multiple: true to the file field. (This does exclude older
versions of IE, but they will simply be able to upload a single file.)
To make this work, the form must be on the parent of the association --
Hi guys,
Has anyone figured out how to test strong parameters?
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to rubyonrails-talk+unsubscr...@googlegroups.
Step zero point one is to review your 6/7 plugins and 5/6 gems and ensure
they've been moved forward to your final target.
On Tuesday, March 4, 2014 4:05:51 AM UTC-5, Colin Law wrote:
>
> On 4 March 2014 05:09, Raju Ay >
> wrote:
> > I would like to upgrade one of my application from rails -2.3
Not sure from your question, you seem to be asking "How do I sort the
Categories index?" but you've provided a link_to that deals with a single
Category. Typically, you'ld order your Categories in the controller index
method and the ordered list would be available in the index.html.erb view
as
Thanks :)
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to rubyonrails-talk+unsubscr...@googlegroups.com.
To po
Hi,
I am newbie to Ruby on Rails.I am trying to develop multiple files
upload sample app using any plugin with Rails 4.0 version,
but I haven't find much information on that over the web.
So,Please suggest me or provide any info to develop it.
Thanks,
Subbu
--
Posted via http://www.ruby-for
Hello Everybody
I have a navigation that draws data from a category table, I would like to
display the navigation by category ID order, this is the code I have so far
<%= link_to category.title, category_path(category) %> in the view
not sure where to go next to get order by category id
Steven
Hello,
I am trying load a drop down list based on selection from first
drop
down list. Based on first drop down list selection, I am able to fetch
data for second drop down list but I am not able to refresh second
dropdown list contents.
How Can I refresh second drop list on selection of fir
On 4 March 2014 05:09, Raju Ay wrote:
> I would like to upgrade one of my application from rails -2.3.11 to 4.0.0.
> Before going to do anything, I just need plan for it and my application not
> that much of big size but got some 6/7 plugins and 5/6 gems.
>
> Existed: Ruby 1.8.7 + Rails 2.3.11
On 3 March 2014 19:57, Alfredo Barrero wrote:
> Good night everyone,
>
> My name is Alfredo Barrero and I'm getting started with RoR. I have been
> learning with "Agile Web Development".
>
> Now I'm trying to do my own web application. I have a problem and I don't
> know what I'm doing wrong, coul
31 matches
Mail list logo